If you often swim in the Internet, you must know the domain name of the website. You can visit the BAN or other websites in http://www.si-bay.com and so on. The IP address is really good.
How to implement intranet in the LAN, build a web server or other servers, use and configuration DNS, which build an internal network of the enterprise, is particularly important. The following is configured with DNS under Linux for some thick discussion.
If you have a server installation mode under Linux, you can select the installation DNS. After the installation is complete, run the service configuration command NTSYSV, and start the DNS service when you start Linux.
The DNS service process is named. After startup, you can provide a domain name resolution service for the DNS client, convert the domain name into an IP address and convert the IP address into domain name.
1. When Named is started, you need to read /etc/named.boot, so /etc/named.boot is the basic configuration file of NAMED. In /etc/named.boot, the specified forward domain is converted to the data file and establish the reverse DNS data file and the top-level domain server file and the backup DNS. Examples of this file are as follows:
· DireTory / var / named
Specify the NAMED to read the DNS data file from the / var / named directory.
Primary qyweb.com dns.hosts
Specify DNS as the primary domain server of the qyweb.com domain, and the DNS.HOSTS file contains all *. Qyweb.com forms of domain name conversion data.
Primary 0.0.127.in-addr.arpa dns.local
Specifies DNS as a 127.0.0 network segment address translation master server, the DNS.local file contains 127.0.0. * The address to the domain name conversion data.
Primary 26.230.10.in-addr.arpa dns.rev
Specify DNS as a 10.230.26 network segment address translation master server, the DNS.REV file contains all 10.230.26. * Conversion data in the form of the domain name.
Cache db.cache
Specify DNS to get the top "root" server address of the Internet from the db.cache file.
There is another named.conf in the same directory with named.boot, and the main role is to define the domain name search mode of the DNS server. Refer to Named.boot to change accordingly.
2, forward domain name conversion data files DNS.hosts include all host nodes in the qyweb.com domain.
@ In soa dns.qyweb.com manager.dns.qyweb.com.
(199511301
28800
7200
3600000
86400)
NS DNS.qyweb.com.
MX 10 dns.qyweb.com.
Localhost A 127.0.0.1
DNS A 10.230.26.5
WWW a 10.230.26.6; if the same machine is with DNS, IP is the same
| -page- |
Mail MX 7 DNS.QYWeb.com. He must take one after the host name. "
FTP CNAME DNS.QYWEB.COM .; must take one after the host name. "
The SOA record defines the basic information of the domain name data.
NS records and MX records define the domain name of the domain name server itself and the name of the mail address corresponding to the UserName @ qyweb.com.
A Record is a record of the DNS domain name to the IP address, it must be. Take DNS.QYWeb.com as an example, in a record in a record, the domain qyweb.com is omitted, only written into NS, named automatically adds qyweb.com according to the definition in Named.boot, in processing, and its corresponding IP address is 10.230 .26.5.
The MX record is a mail address translation record. In this example, the mail address of the username @dns.qyweb.com is defined in this example, that is, the actual mail server is DNS.qyweb.com, where DNS .qyweb.com's priority is 7, usually sent to the priority small host DNS.qyweb.com. The CNAME record defines some alias of some hosts.
3. Reverse DNS Data Files DNS.local and DNS.REV provide the corresponding DNS host name according to the IP address query, each network segment has a data file. For internal network segments 127.0.0 usually only one address, that is, 127.0.0.1 loopback address, DNS.LOCAL content is as follows:
@IN SOA DNS.QYWeb.com Manager.dns.qyweb.com.
(1997022700; Serial
28800; Refresh
14400; RETRY
3600000; EXPIRE
86400); Minimum
INNS DNS.QYWEB.COM.
1 in ptr localhost.
The data file DNS.REV of the external network segment contains conversion data for all host IP addresses to the DNS hostname. The DNS.rev content is as follows:
@Soa dns.qyweb.com. Manager.dns.qyweb.com.
199609206; Serial
28800; Refresh
7200; RETRY
604800; EXPIRE
86400); Minimum TTL
NS DNS.qyweb.com.
5 ptr dns.qyweb.com .; host name is to attach one "."
6 ptr www.qyweb.com .;
2 ptr proxy.qyweb.com .;
The main part is the PTR record. The IP address in the PTR record has only host numbers, and the NAMED will automatically add the previous network number according to the definition of Named.boot.
4, db.cache
On the Linux system, a named.ca has been provided under / var / named or / etc, which contains the top-level domain name server of the Internet, which is best to download the latest version from Internet.
5, change precautions
| -page- |
(1) Increasing or deleting the host in the domain, you need to simultaneously modify the PTR record in the DNS.HOSTS in DNS.HOSTS in Data file DNS.HOSTS.
(2) IP network segment adds a time (10.230. 27.0), add: in /etc/named.boot:
Primary 27.230.10.in-addr.Arpa dns.rev1
The reverse DNS data file adds a file DNS.REV1 that defines a 10.230.27.0 network segment, which is similar to NDNS.REV.
(3) The DNS server can only be removed from the Cache row serving in the enterprise internal network /etc/named.boot.
(4) Establish a backup DNS server DNS1.qyweb.com, the IP address is 10.230.26.10.
Modify DNS.hosts on the primary server, join the record of DNS1.qyWeb.com, and add an NS record to make the named.hosts on the primary server to the following:
@ In ns dns1.qyweb.com.
DNS1 A 10.230.26.10
DNS2 CNAME DNS1.QYWEB.COM.
Simultaneous modifications are then made to the respective reverse DNS data files on the primary server, add the NS records of the backup server, and then restart the named. Reserve DNS Server Configuration: The created profile is only similar to the primary server. Named.boot content is:
Directory / var / named
Secondary qyweb.com 10.230.26.5 DNS.HOSTS
Secondary 0.0.127.in-addr.Arpa 10.230.26.5 DNS.LOCAL
Secondary 26.230.10.in-addr.Arpa 10.230.26.5 DNS.REV
Cache. db.cache
The DB.cache of the backup DNS server is usually copied from the system administrator from the primary server.
After the configuration file is complete, you can start and test the NAMED, use the Linux command NDC, start NAMED with NDC. Use nslookup for forward DNS parsing and reverse DNS analysis:
#nslookup dns.qyweb.com
#nslookup 10.230.26.5
MX email address record check:
#nslookup
> set q = mx
Mail.qyweb.com
CNAME alias record check:
# NALOOKUP
> Sett Q = CNAME
Ftp.qyweb.com, NSlookup
These tests should be reflected in the correct IP address or domain name.
If everything is tested, then the DNS configuration is basically completed, but if you want to add a new service on the Linux server, it is best to perform a check in the above process to ensure that the DNS service is smooth.