Set up a DNS server in Linux (4)

Source: Internet
Author: User
Article Title: setting up a DNS server in Linux (4 ). 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.
6. Improve the security of domain name servers
  
To improve the security of the Domain Name Server, you must control the transmission of files. When configuring named. conf, You can take several measures to enhance security.
  
Options {
  
Allow-transfer {202.103.166.100 ;};
  
};
  
This command specifies that only authorized secondary servers can obtain zone data information from the primary server.
  
Options {
  
Allow-query {192.168.1/24; 127.0.0/8 ;};
  
};
  
This command specifies that only authorized customers can obtain zone data information from the server.
  
Options {
  
Forwarders {202.103.166.194; 202.105.177.100 ;};
  
Forward-only;
  
};
  
This command specifies that only the specified server can be accessed by the cache server.
  
7. Application Instance
  
Assume there is a network in which the proxy is divided into two parts: internet and intranet. To protect the security of the mail server, the proxy is placed on the intranet. Internal users send and receive mails through the internal mail server.
  
Proxy server, dns server, and smtp server are built on the proxy server host.
  
Eth0 ip address: 192.168.1.1
  
Eth1 ip address: 172.16.0.1
  
Smtp server and pop3 server are built on the mail server host.
  
Ip address: 172.16.0.2
  
Your gateway is 172.16.0.1.
  
The dns server is 172.16.0.1.
  
The smtp server is mail.test.com.
  
Pop3 server is mail.test.com
  
We still use "test.com" as an example. We need six basic configuration files:
  
/Etc/named. conf
  
/Var/named. ca
  
/Var/named. local
  
/Var/named/named.test.com
  
/Var/named/named.172.16.0
  
/Var/named/named.192.168.1
  
7.1 create or modify/etc/named. conf:
  
// 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 PM nameserver config
  
//
  
Zone "."{
  
Type hint;
  
File "named. ca ";
  
};
  
Zone "0.0.127.in-addr. arpa "{
  
Type master;
  
File "named. local ";
  
};
  
// There are our primary zone files
  
Zone "test.com "{
  
Type master;
  
File "named.test.com ";
  
};
  
Zone "0.16.172.in-addr. arpa "{
  
Type master;
  
File "named.172.16.0 ";
  
};
  
Zone "1.168.192.in-addr. arpa "{
  
Type master;
  
File "named.192.168.1 ";
  
};
  
The zone "test.com" section in the file declares that this is the master server used for the test.com domain and is used to load data in this domain from the/var/named/named.test.com file. zone "0.16.172.in-addr. the arpa IP address ranges from 172.16.0 to 172.16.0. * To the host name file.
  
The data used for this domain is loaded from the/var/named/named.172.16.0 file. the zone "1.168.192.in-addr. the arpa CIDR block is mapped to the IP address 192.168.1. * To the host name file. the data used for this domain is loaded from the/var/named/named.192.168.1 file.
  
7.2 create or modify/var/named. local
  
@ In soa ns.test.com. root.ns.test.com .(
  
2000051500; Serial
  
28800; Refresh
  
14400; Retry
  
3600000; Expire
  
86400); Minimum
  
In ns ns.test.com.
  
1 in ptr localhost.
  
Note: When modifying the named. * file, you must add the Serial value each time you save the disk. If you use an absolute domain name, do not forget "."
  
7.3 create or modify/var/named/named.test.com
  
@ In soa ns.test.com. root.ns.test.com .(
  
2000051500; Serial
  
28800; Refresh
  
14400; Retry
  
3600000; Expire
  
86400); Minimum
  
In ns ns.test.com.
  
Ns A 192.168.1.1
  
Ns A 172.16.0.1
  
MX 10 ns.test.com.
  
Www A 192.168.1.2
  
Mail A 172.16.0.2
  
MX 10 mail.test.com.
  
MX 20 ns.test.com.
  
7.4 create or modify/var/named/named.192.168.1
  
@ In soa ns.test.com. root.ns.test.com .(
  
2000051500; Serial
  
28800; Refresh
  
14400; Retry
  
3600000; Expire
  
86400); Minimum
  
In ns ns.test.com.
  
1 in ptr ns.test.com.
  
2 in ptr www.test.com.
  
7.5 create or modify/var/named/named.172.16.0
  
@ In soa ns.test.com. root.ns.test.com .(
  
2000051500; Serial
  
28800; Refresh
  
14400; Retry
  
3600000; Expire
  
86400); Minimum
  
In ns ns.test.com.
  
1 in ptr ns.test.com.
  
2 in ptr mail.test.com.
  
Assume that when the user sends an email to the tom@hotmail.com, the mail is first delivered to the mail.test.com host,
  
The mail.test.com host is passed to the ns.test.com host, and then the ns.test.com host is delivered to mail.hotmail.com. Then, tom is used to get an email from the mail.hotmail.com host.
  
When tom on hotmail.com wants to send an email to a user on mail.test.com, the parser on the tom machine first obtains the Domain Name Information of test.com, and then the mail client first sends it to the mail.test.com host based on the mail delivery route, the mail.test.com host is an internal host and cannot be accessed by internet users. then the mail client sends the mail to the ns.test.com host based on the mail delivery route. because the ns.test.com host is on the internet, the ns.test.com host receives the email and forwards it to the mail.test.com host in the same network segment. Then, the user obtains the email from the mail.test.com host.
  
8. Integration with Microsoft dns
  
Microsoft dns defines a new type of WINS resource record, which is attached to the root zone of the domain. this record tells Microsoft's DNS server how to contact the WINS server and solve the problem of querying the host name without static DNS records.
  
For example, a WINS resource record is as follows:
  
@ In wins 192.168.1.100
  
To enable DNS and WINS cooperation, select the properties record of the corresponding domain in Microsoft's DNS server configuration, and enable WINS resolution in the wins lookup tag.
  
Since a non-standard resource record is used, most other DNS does not support this type of resource record, such as when a computer that is not Microsoft dns attempts to transfer a zone from a microsoft DNS Server with a DNS-WINS resource record, the computer may have an error.
  
9. DNS Fault Diagnosis
  
Most DNS faults are caused by syntax errors in the configuration file, or an incorrect address is assigned to the wrong computer. For DNS fault diagnosis, refer to the following guidelines.
  
9.1 check and confirm the spelling of host names for all records. Remember that the absolute address ends.
  
9.2 If any modification is made to the partition file, the serial number in the SOA record must be modified. This ensures that the server correctly uploads the file again.
  
9.3 confirm that the name and IP address entered in the primary area match the reverse pointer information in the reverse pointer file.
  
9.4 Microsoft DNS servers use non-standard resource records, which may cause problems.
  
  
  

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.