DNS server configuration under Linux

Source: Internet
Author: User
Tags domain name server nameserver

One, understand the meaning of some nouns

@----This symbol means that SOA is the same as a domain
In-----in is a domain name class that provides an IP address when used with a a,ptr or CNAME record, the domain name can be mapped to an IP address,
Conversely, NS-----domain name or IP address of the zone DNS server specified by the domain name server
MX----MX records define what machine to send e-mail to a domain or a single host, defined for the domain to tell everyone to mail
Sent to the person or machine in the domain to communicate with
SOA-----Start of authority indicates that the following domain name defines the e-mail address of the primary domain name server and the contact point for that domain.
PTR---Map IP addresses to host names, and PTR records perform the reverse process of a and record
A----Map the hostname to its IP address
Two, download install bind, download and install a lot of methods, can be free to play, I used a command to fix, if you feel convenient
You can also do this:
Yum Install bind

Three, some need to configure the file interpretation
/etc/hosts
/etc/host.conf
/etc/resolv.conf
/etc/named.conf
/var/named/named.192.168.1
/var/named/named.by.com

1, first configure/etc/hosts
Specifies IP-to-host mapping, such as
#IP Address Hostname Alias
127.0.0.1 localhost
192.168.1.254 DNS dns.by.com

2. Next is
Configuration of the/etc/host.conf
--------------------------------------------------------
Order hosts, bind
Multi on
--------------------------------------------------------
This configuration means that the query starts from/etc/hosts, then DNS, if multiple hosts are returned.


3. Configuration
/etc/resolv.conf
--------------------------------------------------------
Search by.com
NameServer 192.168.1.254
--------------------------------------------------------
Here the DNS client is configured, search specifies the client default domain, the name, and nameserver is the specified use
The IP address of the DNS server, which is using the host IP address of the DNS server being configured: 192.168.1.254
4. Configure/etc/named.conf, the configuration of this document is very important
Generated by named-bootconf.pl
Options {
Directory "/var/named";
/*
* If There is a firewall between your and nameservers you want
Might need to uncomment the Query-source
* directive below. Previous versions of BIND always asked
* Questions using port, but BIND 8.1 uses an unprivileged
* Port by default.
*/
Query-source address * port 53;
};
A caching only nameserver config
//
Zone "." {
Type hint;
File "named.ca";
};
Zone "0.0.127.in-addr.arpa" {
Type master;
File "Named.local";
};
Zone "1.168.192.in-addr.arpa" {
Type master;
File "named.192.168.1";
};
Zone "By.com" {
Type master;
File "named.by.com";
};
Inside the//after and/* * * * * contents are comments, especially to note that the punctuation inside to correct,
Zone "1.168.192.in-addr.arpa" is the configuration of the reverse order lookup, while zone "By.com" is the configuration of the positive order lookup
5. Create a zone data file/var/named/named.192.168.1, simply copy the/var/named/named.local
/var/named/named.192.168.1 to modify (note: copy is not renamed), the modified content is as follows:
---------------------------------------------------------
@ in SOA dns.by.com. Hostnaster.dns.by.com. (
1997022700 Serial
28800 Refresh
14400 Retry
3600000 Expire
86400) Minimum
In NS dns.by.com.
1 in PTR dns.by.com.
---------------------------------------------------------
Each punctuation must be correct!

6. Create the data file/etc/named.by.com, the correct result is as follows:
---------------------------------------------------------
@ in SOA dns.by.com. Hostmaster.dns.by.com. (
1997022700 Serial
28800 Refresh
14400 Retry
3600000 Expire
86400) Minimum
In NS DNS
DNS in A 192.168.1.254

www in CNAME DNS
----------------------------------------------------------
Here NS is the domain name server, A is the address record, the CNAME is the canonical name path also refers to the substitution, namely uses the dns.by.com
The same as www.by.com.


7. After careful checking to ensure correct, restart the DNS daemon named:
#/etc/rc.d/init.d/named restart

8. Check that the DNS server first telnet to 192.168.1.254, then ping the external URLs, and then use Nslookup
correctly, the DNS server is configured successfully. At this point the intranet computer can be used 192.168.1.254 as the domain name server.
(Probably the process, I reverse parse the whole, the browser test did not succeed, it is estimated that the DHCP server can not be specified statically, so it is not measured)

DNS server configuration under Linux

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.