After the installation is successful, you get the main directory, / etc / bind . In this directory, you will configure the following files:
/etc/bind/named.conf.local
/etc/bind/db.local
DNS database file (eg /etc/bind/db.hoanghac.org )
First, open the file /etc/bind/named.conf.local and add a new zone, such as hoanghac.org :
zone "hoanghac.org" {
type master;
file "/etc/bind/db.hoanghac.org";
};
Next, create the DNS database file /etc/bind/db.hoanghac.org by copying the content from the sample file /etc/bind/db.local :
# cp /etc/bind/db.local /etc/bind/db.hoanghac.org
At this point, edit the file /etc/bind/db.hoanghac.org by replacing localhost. equal to the full name of the DNS server (FQDN). Replace 127.0.0.1 with the IP address of DNS Server and root.localhost to an exact email address, but use the "." instead of the "@" symbol, you also create a record (A) corresponding to ns.hoanghac.org . The contents of the file will look like this:
;
; BIND dữ liệu tập tin cho địa chỉ loopback interface
;
$ TTL 604800
@ IN SOA ns.hoanghac.org. root.hoanghac.org. (
2 ; Serial
604800; Refresh
86400; Retry
2419200; Expire
604800); Negative Cache TTL
;
@ IN NS ns.hoanghac.org.
@ IN A 192.168.1.10
@ IN AAAA :: 1
ns IN A 192.168.1.10
Next, restart the BIND9 service for the configuration operations to take effect:
# /etc/init.d/bind9 restart
To check the performance of the DNS Server, use the ping command as follows:
# ping ns.hoanghac.org