Implementation of virtual domain name under Linux (1) _unix Linux

Source: Internet
Author: User

Currently Linux operating system is very hot, so many friends want to know about Linux under the virtual domain name implementation process. The following is based on the current more popular Redhat to discuss. First, DNS server settings

We know that the Internet is based on TCP/IP protocol, to communicate must obtain the IP address of each other, this is achieved through the DNS server. Therefore, to implement a virtual domain name, the DNS server should first accept the virtual domain name, that is, map it to the specified IP address. Because we rely on Web servers to differentiate domain names, this IP address should naturally be managed by the Web server.

Bind DNS servers are bundled in the RedHat6.0 operating system. Its domain name profile is "/etc/named.conf", in general, the domain configuration file is placed under the "/var/named" directory.

Example 1, named.conf file configuration:

Zone "domain.com" {
Type master;
File "domain.com";
};
Zone "0.10.10.in-addr.arpa" {
Type master;
File "10.10.0";
};

This example shows that the domain profile for "domain.com" is "/var/named/domain.com", and that the reverse domain configuration file is "/var/named/10.10.0". The domain.com file is responsible for mapping DNS domain names to IP addresses.

Example 2, domain.com file configuration:

@ in SOA dns.domain.com. Hostmaster.dns.domain.com. (
1998111003; Serial
3600; Refresh
900; Retry
1209600; Expire
43200; Default_ttl
)
@ in MX ten dns.domain.com.
@ in NS dns.domain.com.
@ in A 10.10.0.1
www in A 10.10.0.1

Assuming the added domain name is aaa.domain.com, you want to add an alias record to the Www.domain.com,DNS service, which can be written as:

AAA in CNAME www.domain.com.

If you need to configure a large number of virtual domain names, domain.com files are very large, but also very cumbersome. We can use the symbol "*", that is, to add in the domain.com file:

* in CNAME www.domain.com.

So it turned all the records that were not set to the end of domain.com to www.domain.com, whether it was aaa.domain.com or bbb.domain.com. This does not affect existing records. You should restart the daemon after you configure the DNS server named:

[root@domain/root]#/etc/rc.d/init.d/named Restart (source: pconline)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.