LINUX Study Notes: DNS server settings

Source: Internet
Author: User
Tags nameserver
Article Title: LINUX Study Notes: DNS server settings. 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.

Install and learn REDHAT LINUX7.0 half a month ago. As a newbie to Linux, I encountered some inevitable problems. By reading books and materials, viewing BBS, I tried to solve some problems.

Think of your own experience and lessons for others to learn from, so you can write it out, and save it as study notes, and hope to help your friends who have just started Linux. Due to my limited ability, it is inevitable that there are some omissions in my notes. Please also master Hai Han.

  1. Introduction to DNS

DNS is the Domain Name System, which can convert a Domain Name like www.szptt.net.cn (Shenzhen window) to an IP address like 202.96.134.163. If there is no DNS, When you browse the Shenzhen window, you must use numbers that are so hard to remember as 202.96.134.163. The computer that provides the DNS service is the DNS server.

There are three types of DNS servers: Cache-only server, Primary Name server, and Second Name Server ).

The detailed principles, workflows, terms, and concepts of DNS are limited by space. Can read special articles such as DNS-HOWTO to learn.

  Ii. Set the target

A RedHat Linux7.0 computer with the IP address 10.0.0.39 and the host name netfinity.zrs.com. The local area network already has a DNS server with the address 10.0.0.211. It is responsible for parsing the domain baoan.gov.cn. Now we need to configure a DNS server on 10.0.0.39 to be responsible for zrs.com domain resolution and serve as a secondary DNS server for the baoan.gov.cn domain. You can download the compressed packages of all related files from here.

 3. Configure the local host as the primary DNS server in the ZRS. COM domain

The dns function in Linux is implemented through the bind software. After the bind software is installed, several inherent files are generated, which can be divided into two categories: configuration files under the/etc directory and dns record files under the/var/named directory. Add other related files to set up the dns server. The following is a list and description of all files related to dns settings.

The first category: hosts, hosts. conf, resolv. conf, named. boot, and named. conf under the/etc directory.

1. In the "hosts" file, the host name and IP address are defined, and the IP address and Host Name of the computer that will run dns are also defined. Content:

127.0.0.1 localhost. localdomain localhost
10.0.0.39 netfinity.zrs.com netfinity
2. In the "hosts. conf" file, the "order hosts bind" statement specifies that the resolution sequence for the host name is first found in hosts, and then found in the dns server record. "Multi on" allows a host name to correspond to multiple IP addresses. Content:
Order hosts, bind
Multi on
Nospoof on
3. In the "resolv. conf" file, "nameserver 10.0.0.211" specifies the address of the dns server. Note: This file is essential for computers that do not use dns servers (non-windows systems; Windows systems set this file in "Network Properties. If you have not set the local machine as a dns server, you must specify the address of a dns server to resolve the domain name. You can write up to three addresses as the candidate dns server for the previous failure. "Domain zrs.com" specifies the default domain. File Content:
Domain zrs.com
Nameserver 10.0.0.39
4. The "named. boot" file is the configuration file used by the bind software of earlier versions. Now the new version has already been stored in "named. conf ". Named. conf is the core file of dns server configuration. The following is a piece of explanation.

// 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 the original content of the named. conf file automatically generated by the system after you install the bind software. "Directory" specifies the directory where dns record files are stored:/var/named. The text starting with "//" is the description text. The following two "zones" statements define the dns server root and the corresponding reverse query domain, and point out that the root record file is "name. ca, the record file of the root reverse query domain is "named. local ". These two record files are also provided by the system and do not need to be modified. This part of the named. conf file does not need to be modified.

[1] [2] Next page

Related Article

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.