Introduction to the method of configuring DNS server under Linux operating system

Source: Internet
Author: User
Tags bind mail query nameserver nslookup nslookup tool linux

There are two mail servers 192.168.1.1 (under Windows host name b.test.cn) and 192.168.1.3 (Linux under host name is a.test.com).

Configure the DNS server under Linux, and here are some of the files that were set during the configuration process.

The specific contents of the/etc/hosts document are as follows:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost fc4
192.168.1.3 a.test.com a
192.168.1.1 b.test.cn b

/etc/host.conf file:

Order Hosts,bind

The first to use the Hosts file parsing, in the use of DNS resolution

/etc/resolv.conf file:

; Generated by NetworkManager, does not edit!
Search test.com
NameServer 127.0.0.1
Search test.cn
NameServer 192.168.1.1
NameServer 61.144.56.100
/etc/named.conf file:
//
named.conf for Red Hat caching-nameserver
//
Options {
Directory "/var/named";
Dump-file "/var/named/data/cache_dump.db";
Statistics-file "/var/named/data/named_stats.txt";
/*
* If There is a firewall between for you and nameservers for you want
* To talk to, your 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
//
Controls {
inet 127.0.0.1 allow {localhost;} keys {rndckey;};
};
Zone "." in {
Type hint;
File "named.ca";
};
Zone "test.com" in {
Type master;
File "test.com";
allow-update {none;};
};
Zone "1.168.192.in-addr.arpa" in {
Type master;
File "192.168.1.rev";
allow-update {none;};
};
Zone "test.cn" in {
Type master;
File "test.cn";
allow-update {none;};
};
Zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" in {
Type master;
File "Named.ip6.local";
allow-update {none;};
};
Zone "255.in-addr.arpa" in {
Type master;
File "Named.broadcast";
allow-update {none;};
};
Zone "0.in-addr.arpa" in {
Type master;
File "Named.zero";
allow-update {none;};
};
Include "/etc/rndc.key";

Under the/var/name/test.com file:

$TTL 86400
@ IN SOA a.test.com. root.a.test.com (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS a.test.com.
IN MX 10 mail.test.com.
a IN A 192.168.1.3
mail IN A 192.168.1.3

Where the meaning of root.a.test.com is the administrator's mailbox

Under/var/name/test.cn file:

$TTL 86400
@ IN SOA b.test.cn. root.a.test.com (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS b.test.cn.
IN MX 10 mail.test.cn.
b IN A 192.168.1.1
mail IN A 192.168.1.1

Under/var/name/192.168.1.rev file:

$TTL 86400
@ IN SOA 1.168.192.in-addr.arpa. root.test.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS a.test.com.
IN NS b.test.cn.
IN MX 10 mail.test.com.
IN MX 10 mail.test.cn.
3 IN PTR a.test.com.
3 IN PTR mail.test.com.
1 IN PTR b.test.cn.
1 IN PTR mail.test.cn.

Then use/etc/init.d/named Restart Restart the DNS service, in the restart process, I have been several times the error, as prompted by the error, will be prompted named.conf file in the first few lines of error. Or prompts in those containing files such as test.cn these files inside the problem, and then an exclusion.

Finally, there are some nslookup commands that are more useful:

Set all is used to display some information about the DNS server on this machine using the Nslookup tool

Set Type=any displays complete information including the name and IP address of the mail server and the master-slave DNS server in the domain

Server 192.168.0.1 The DNS server address of the replacement query.



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.