Recently, to configure DNS on the LAN (sharing the Internet at the same time), it took 2 days to write the ok! configuration process,
Hope to be helpful to junior brother.
First, the network environment
In a small enterprise LAN, there are multiple computers, one of which is a NAT Gateway (10.198.253.148) Pass
ADSL shared Internet access. Now need to do a DNS service, the sharing of the Internet DNS resolution by this DNS server to provide;
At the same time, the computer in the enterprise to assign domain names, and use the domain name to access.
It is assumed that the domain of the enterprise is kaifa.com, the domain name that needs to be resolved has mail.kaifa.com (10.198.253.239),
Www.kaifa.com (10.198.253.228), DNS server domain name dns.kaifa.com (10.198.253.239).
Prerequisite: Named has been run. Its version is 8.3.3-rel. Please refer to the other information for the description of the following configuration file.
Ii. contents and description of the configuration document
1,/etc/resolv.conf
Domain kaifa.com
NameServer 127.0.0.1
2,/etc/namedb/named.conf
Add to:
Forwarders {
202.96.128.68
};
This is the Guangzhou DNS server IP on the Internet, which is used to share the Internet. You can not or may not set other DNS IP.
Zone "Kaifa.com" {
Type master;
File "Kaifa.com.db";
};
This is the kaifa.com domain resolution data file
Zone "253.198.10.in-addr.arpa" {
Type master;
File "Kaifa.com.rev";
};
This is kaifa.com reverse domain parsing data file
3, create the/etc/namedb/kaifa.com.db file, the contents are as follows:
$TTL 3600
@ in SOA dns.kaifa.com. Root.dns.kaifa.com. (
2003022102; Serial
28800; Refresh
7200; Retry
604800; Expire
86400; Minimum
)
In NS dns.kaifa.com.
localhost in A 127.0.0.1
DNS in A 10.198.253.239
www in A 10.198.253.228
Mail CNAME DNS
4, create the/etc/namedb/kaifa.com.db file, the contents are as follows:
$TTL 3600
@ in SOA dns.kaifa.com. Root.dns.kaifa.com. (
2003022101; Serial
28800; Refresh
7200; Retry
604800; Expire
86400; Minimum
)
In NS dns.kaifa.com.
228 in PTR www.kaifa.com.
239 in PTR mail.kaif.com.
5, #ndc reload//allow this command to take effect under root.
6, #nslookup//testing.
7, as long as the other computer DNS settings for 10.198.253.239 can be resolved www/mail/dns.kaifa.com.
Third, PostScript
I checked a lot of information, but after all, is the first configuration, inevitably wrong, I hope you will correct me!