DNS configuration under Linux

2010-05-13  来源:本站原创  分类:OS  人气:277 

1, DNS Introduction

DNS is the Domain Name System, it can convert the IP address of the domain name; no DNS, visit the Web site, it must be so hard to remember similar number to access. Provide DNS services that computer, that is, DNS server.
DNS server can be divided into three types, the cache server (Cache-only server), the primary server (Primary Name server), the secondary server (Second Name Server).

DNS details of principles, processes, terminology, concepts, space is limited, can not say here. Can read the specific articles, such as the DNS-HOWTO to learn.

Second, set goals

RedHat Linux7.0 a computer, IP is, the host name is netfinity.zrs.com. Located in the LAN has a DNS server address is, responsible for analysis baoan.gov.cn this domain. Now to configure a DNS server, it is responsible for zrs.com analytical work in this field, but also as a secondary DNS server baoan.gov.cn domain. Archive of all relevant documentation is available here.

Third, configure the machine as the primary DNS server domain ZRS.COM

Dns function under Linux through the bind software implementation. bind the software installed, will have several inherent document is divided into two categories, one is the configuration file in the / etc directory, a class is the dns log file in / var / named directory. Together with other relevant documents, a common set dns server. Here are all the dns settings and a list of related documents and instructions.
The first category: in the / etc directory are: hosts, hosts.conf, resolv.conf, named.boot, named.conf.

1, "hosts" file, defines the hostname and ip address of the correspondence, which also will run on this computer dns ip address and host name. Content: localhost.localdomain localhost netfinity.zrs.com netfinity
2, "hosts.conf" file, "order hosts bind" statement, specifies the host name resolution order is the first to find hosts, and then to the dns server records in search. "Multi on" is to allow a host name corresponding to multiple ip addresses. Content:
order hosts, bind
multi on
nospoof on
3, "resolv.conf" file, "nameserver" assigned dns server address. Note that this document on ordinary non-dns server computer (non-windows systems; Windows system is in the "Network Properties" set this to) who is indispensable. If you do not set the machine for the dns server, you have to be able to resolve domain name, you must specify a dns server address. You can write up to three addresses, a failure as a former candidate for dns server. "Domain zrs.com" specify the default domain. Content of the document:
domain zrs.com
4, "named.boot" file is an earlier version of the bind software configuration file, and now the new version has given way to "named.conf". named.conf dns server is the core configuration file. Here we have a section to explain.
/ / Generated by named-bootconf.pl

options (
directory "/ var / named";
/ *
* If there is a firewall between you and nameservers you want
* To talk to, you might need to uncomment the query-source
* Directive below. Previous versions of BIND always asked
* Questions using port 53, but BIND 8.1 uses an unprivileged
* Port by default.
* /
/ / Query-source address * port 53;

/ /
/ / A caching only nameserver config
/ /

zone "." IN (
type hint;
file "named.ca";

zone "0.0.127.in-addr.arpa" IN (
type master;
file "named.local";
allow-update (none;);

This part is after you installed the bind software automatically generated the named.conf file of the original content. "Directory" specify the dns log file storage directory is / var / named. "/ /" At the beginning of the text is the text, not hell. Then the two "zone" statement defines the root dns servers and the corresponding inverse query domain, and pointed out that the root of the log file is "name.ca", the reverse query root domain log file is "named.local" . This is also the system comes with two log files, and do not have to change it. This part of the named.conf file, we do not have to change it.

But we can "diretory" add a line under: forwarders (;). dns telecom here is my server address, forwarders parameters specified in the subsequent location of the server ip dns server as the alternative. That is, the dns can not resolve the machine's host is sent to the alternative dns server to parse it.

zone "zrs.com" IN (
type master;
file "named.zrs.com";
allow-update (none;);
zone "0.0.10.in-addr.arpa" IN (
type master;
file "named.zrs.com.rev";
allow-update (none;);

This part is manually added. Defines "zrs.com" The query domain and the corresponding reverse domain. "Type master" of the present machine is the "zrs.com" and "0.0.10.in-addr.arpa" The two primary dns server domain (primary name server). "Named.zrs.com" and "named.zrs.com.rev" is the domain of the log file. These two documents is their own creation, we take a look at the following two documents.

The second category: Resource Record file, located in / var / named directory. This directory is defined in named.conf.
1, named.zrs.com files as follows:

@ IN SOA netfinity.zrs.com. Root.netfinity.zrs.com. (
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
IN NS netfinity.zrs.com.
IN MX 10 netfinity.zrs.com.

netfinity IN A
lily IN A
www IN CNAME netfinity.zrs.com.
pop3 IN CNAME netfinity.zrs.com.
smtp IN CNAME netfinity.zrs.com.

In this log file, there were 5 types of records. SOA is to empower the start (Start Of Authority) of the abbreviation, followed by writing your dns server host name, here is "netfinity.zrs.com.". (Note that the host name of the back of a small dot. Those who appear in the log file of the host name, recall should add this to the small dot.) NS is the name of the server resource records, specify the domain name server, this is the dns server. MX is a mail exchange resource records are to specify the domain of the mail server. You can write multiple MX records, specify multiple mail servers, priority number after the decision by the MX, the smaller the number, the higher priority mail server. A is a host record, the host and ip address correspond. CNAME is an alias record, it gives a host of different names, such as www.zrs.com, pop3.zrs.com actually point to the same host netfinity.zrs.com.
2, named.zrs.com.rev file contents:
@ IN SOA netfinity.zrs.com. Root.netfinity.zrs.com. (
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
IN NS netfinity.zrs.com.
211 IN PTR netfinity.zrs.com.
139 IN PTR lily.zrs.com.
This is the "zrs.com" reverse domain log files, it allows dns server ip address lookup from the host name of services. PTR record of ip and host name to correspond. Since some will be asked to reverse query, so the reverse query the domain log file is best not to be omitted.
This point, you have successfully configured a dns server that can resolve "zrs.com" This field has.

Fourth, configure the machine to BAOAN.GOV.CN secondary dns server domain

Secondary DNS server can be set from the master server in the domain information transfer. District files are transferred from the main server, and also as a local disk file is stored in the secondary server. In the secondary server has a complete copy of domain information, so it can answer queries in this domain. This part of the configuration as follows:
zone "baoan.gov.cn" IN (
type slave;
file "named.baoan.gov.cn";
masters (;);
allow-update (none;);
zone "0.0.10.in-addr.arpa" IN (
type slave;
file "named.baoan.gov.cn.rev";
masters (;);
allow-update (none;);
Can be seen, and the primary DNS server in different places is: "type" to a "slave", and then specify the primary DNS server address "masters (;);". DNS service starts automatically connect, read BAOAN.GOV.CN domain information, and then saved to the machine named.baoan.gov.cN file. I just through this function to the original (system windows2000) on a copy of all records to on.

5, test DNS server

Altered the corresponding DNS file, use the "service named restart" command to restart the service, so changes to take effect. To test the DNS, you can find a client to its DNS address set to the newly created DNS server address, then try the Internet or receive downloads. You can also use nslookup command: Run nslookup, enter the host name query to see whether to return the correct ip address.

  • DNS configuration under Linux 2010-05-13

    1, DNS Introduction DNS is the Domain Name System, it can convert the IP address of the domain name; no DNS, visit the Web site, it must be so hard to remember similar number to access. Provide DNS services that computer, that is, DNS

  • The whole process of configuration under Linux ftp 2010-05-28

    In the configuration under Linux Ftp Summary: 1, create a new user in Linux, the command is as follows: # Useradd username 2, set a password for the username, the command is as follows: # Passwd username # Set the password: password 3, testing the va

  • Detailed installation and configuration under linux vsftp 2010-10-14

    Detailed installation and configuration under linux vsftp 1, run the command yum install vsftpd Specific details are as follows: (If you can not update, you first configure access to the Internet, I have a document called CentOS in VMware, how to net

  • ssh server configuration under linux 2011-03-12

    ssh server configuration under linux SSH server: Since telnet is not very safe, so I need to remotely control an online service to my Linux host, then it should be how to do it! ? The best way of course, is a more secure online mechanism for programs

  • Installation and configuration under Linux tomcat 2011-03-16

    Installation and configuration under Linux tomcat (1), the official website to download Apache apache-tomcat-6.0.29.tar.gz file. (2), extract and unpack Enter the command: tar-zxvf apache-tomcat-6.0.29.tar.gz In the directory under apache-tomcat-6.0.

  • Memcached installation and configuration under Linux 2011-01-27

    Memcached installation and configuration under Linux Home http://www.danga.com/memcached Download: http://danga.com/memcached/download.bml Download file memcached-1.2.6.tar.gz tar zxvf memcached-1.2.6.tar.gz . / Configure - prefix = / usr/local/memca

  • Mysql installation and configuration under Linux getting started 2011-06-01

    Mysql installation and configuration under Linux getting started

  • DNS service configuration under Linux 2011-04-29

    Linux-based DNS service configuration [Required] 1, DNS server IP address set to 192.168.XX.2 2, create a forward lookup zone study.com. 3, set the Forward Lookup Zones Host: www.study.com 192.168.XX.10 mail.study.com 192.168.XX.11 ftp.study.com 192.

  • linux dns configuration 2010-06-04

    Directly edit / etc / resolv.conf Add the correct DNS address. As follows: nameserver xxx.xxx.xxx.xxx

  • Linux SUSE version of DNS configuration --- solution can not ping external domain names 2010-12-23

    Requirements: projects need to pass the host can ping outside domain name, but the company's SUSE hosts to ping the default is not true. Dogs search a little, a lot of information very quickly get to record the following # Cat / etc / resolv.conf dom

  • --- Linux SUSE version of the DNS configuration can not ping outside of the domain name to resolve 2010-12-23

    Requirements: The project needs outside the host can ping the domain name, but the company's SUSE hosts to ping the default is unreasonable. Dogs search a bit, a lot of information, quickly get to record the following # Cat / etc / resolv.conf domain

  • OpenSSH installation and configuration of Linux 2010-12-10

    Many network programs, such as telnet, rsh, rlogin, or rexec, with clear (plain text) to send the password and secret information, so you can use any computer connected to the network monitoring these procedures and communication between the server a

  • Network configuration under LINUX 2011-05-13

    Routing table and static routing route command output Item Description Destination network segment or host target Gateway gateway address, "*" indicates target is the host belongs to the network, without routing Genmask netmask Flags mark. Some

  • vncserver configuration under linux vnc client and win the next 2010-02-24

    - Begin vnc remote desktop - NOTE: start the information from the server log which should be the desktop that [the first time the desktop 1] 1, look at the server started yet? [Root @ 10 first] # ps-ef | grep vnc root 6608 6567 0 21:38 pts / 0 00:00:

  • [Change] PHP development environment configuration LAPM [LINUX System] 2010-04-09

    The so-called LAPM is actually Linux + Apache + PHP + Mysql shorthand, in fact, only these are not enough, the saying goes, better to change plans quickly, It's true, but told him to LAPM it here for the time being. Since it is a web site, in additio

  • Installation and Configuration of linux on telnet 2010-05-25

    I am using centos5, install telnet. Step One: Install yum install telnet Confirmed by y, to continue the installation until the installation is complete. Step two: Change / etc / xinetd.d / telnet configuration file inside. service telnet ( flags d =

  • Telnet function configuration under Linux 2010-06-28

    According to online information, and practice my linux installation, configuration, follow these steps: 1, into the / etc / xinetd.d / directory, if there is no telnet file, the next machine I have krb5-telnet file 2, copy the krb5-telnet file, renam

  • Mysql installation and configuration under Linux 2010-07-16

    1, download MySQL for Linux installation file Linux, MySQL needs to install the following two files: MySQL-server-5.1.7-0.i386.rpm Download address: http://dev.mysql.com/downloads/mysql/5.1.html , open this page, scroll down page to find "Linux x86 g

  • Configuration under Linux and Win VncServer under the Vnc client 2010-08-09

    VNC was originally developed by the AT & T is a system for remote management software. Its mode of operation similar to the now common under Windows Remote Desktop, of course, their qualifications than the older Windows's Remote Desktop. Under the VN

  • FTP server configuration under linux [vsftp] 2010-08-12

    vsftp is meant Very Security Ftp, following what it says on the summary of the configuration and use, through the introduction of this article and hope you can understand in Linux to configure a network service under the basic process 1. Related Prof