The system used in this article is the latest stable version of Debian. Many tutorials do not expire, and the bind9 configuration file has changed a lot.
Use the include Method for configuration.
Several documents used in this article:
/Etc/bind/name. conf. Local
/Var/Cache/bind/
Set the host name to example when the local domain name is used to install the system
1. Install
# Apt-Get install bind9
2. Planning
Local IP Address: 192.168.1.10
Default Domain Name: example.test.com // test.com is not actually registered, it is actually a LAN
3. Edit the configuration file
① Edit named. conf. Local
Add the following statements
// Reverse Region
Zone "1.168.192.in-ADDR. Arpa "{
Type master;
File "/etc/bind/db.192.168.1 ";
};
// Forward Region
Zone "example.test.com "{
Type master;
File "/etc/bind/db.example.test.com ";
};
② Create the db.192.168.1 file under/etc/Bind
$ TTL 604800
@ In SOA example.test.com. root.example.test.com. (// note that there is a point later
1; Serial
604800; refresh
86400; retry
2419200; expire
604800); negative cache TTL;
@ In NS example. Test. com. // note
10 In PTR example.test.com.
③ Create the db.example.test.com file under/etc/Bind
$ TTL 604800
@ In SOA example.test.com. root.example.test.com .(
1; Serial
604800; refresh
86400; retry
2419200; expire
604800); negative cache TTL;
@ In NS example.test.com.
Example in a 192.168.1.10
4. Copy
Copy the two created dB files to the/var/Cache/bind/folder.
5. Restart named.
Rndc reload
Rndc reconfig
/Etc/init. d/bind9 restart
DNS configuration is complete at this location
6. Test
Ping example.test.com.
Ping 192.168.1.10. If name analysis exists, the configuration is successful.
Similarly, you can use NSLookup to test whether a relative result is displayed by entering the domain name and IP address.
The standard is just a guide. There should be many zones in the real DNS, and you can add the host to the current DNS server continuously. (add the IP address and domain name of the host. Note,
The host must have the same domain name: test.com, and different host names). Follow the instructions in this article to add the domain name. The real DNS server is successfully configured.
Note: bind9 must be restarted after the configuration file is changed.