Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1

forwarders by replacing 8.8.8.8 shown in this example with the IP
address of your provider’s DNS server:


Click here to view code image
forwarders {
8.8.8.8;
};


Save the file and exit.


Now you must create a zone definition file. First, create a directory to hold it:


Click here to view code image
matthew@seymour:~$ sudo mkdir /etc/bind/zones


Then create a new file but replace example.com in this example with your
domain:


Click here to view code image
matthew@seymour:~$ sudo touch /etc/bind/zones/example.com.db


This zone definition file will contain all the addresses and machine names that
you are hosting. This is where you enter all the DNS records discussed in the
previous section of the book. Each record gets its own line. For human
readability, it is nice to put an empty line after each one and start each record
with a comment, using // to begin comment lines. In this example, replace
example.com with your domain, replace ns with the domain for your DNS
server, and enter whatever other records you wish to enter, modifying as the
comments note here:


Click here to view code image
example.com. 14400 IN SOA ns.example.com. admin.ns.example.com. (
2013080600 ; serial number
86000 ; refresh rate in seconds
7200 ; update retry in seconds
3600000 ; expiration in seconds
600 ; minimum in seconds )
// Replace the following lines as necessary:
// example.com = your domain name
// ns1 = your DNS server name
// mta = your mail server name
example.com. IN NS ns1.example.com.
example.com. IN MX 10 mta.example.com.
// Replace the IP address with your IP addresses.
www IN A 192.168.0.2
mta IN A 192.168.0.3
ns1 IN A 192.168.0.1


Now restart BIND:

Free download pdf