Implementation of virtual domain names in Linux (1)
Source: Internet
Author: User
Article title: implementation of virtual domain names in Linux (1 ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Author: Zheng Tao/ASPCool
At present, the Linux operating system is very popular, so many friends want to know about the implementation process of virtual domain names in Linux. Next we will discuss it based on the popular RedHat.
1. DNS server settings
We know that the internet is based on the TCP/IP protocol, and the IP address of the other party must be obtained for communication. 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 Web servers.
The bind dns server is bound to the RedHat6.0 operating system. Its domain name configuration file is "/etc/named. conf". Generally, the domain configuration file is placed under the "/var/named" directory.
Example 1: configure the named. conf file:
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 configuration file of "domain.com" is "/var/named/domain.com", and the reverse domain configuration file is "/var/named/10.10.0 ". The domain.com file maps the DNS domain name to an IP address.
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 10 dns.domain.com.
@ In ns dns.domain.com.
@ In a 10.10.0.1
Www in a 10.10.0.1
Assume that the domain name to be added is aaa.domain.com. if you want to name www.domain.com, add an alias record to the DNS service. you can write it as follows:
Aaa in cname www.domain.com.
If you need to configure a large number of virtual domain names, the domain.com file is very large and troublesome. We can use the symbol "*" to add the following to the domain.com file:
* In cname www.domain.com.
In this way, all records ending with domain.com that have not been set are transferred to www.domain.com, whether aaa.domain.com or bbb.domain.com. This does not affect existing records. After configuring the DNS server, restart the Daemon named:
[Root @ domain/root] #/etc/rc. d/init. d/named restart
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.