1. Check and Start the BIND9 Service
Before modifying any configuration, check the status of the BIND9 service. If it isn’t running, start it with the command below:2. Update the BIND Configuration
To configure the new zone, open the filenamed.conf.local using a text editor like Vim. You may remove the default comments and any pre-populated lines to start fresh.

named.conf.local, add the following zone definition for my.kodekloudlab.com. The configuration specifies that this server is the primary (master) for the zone, and it points to the corresponding zone file where the DNS records are stored.
3. Create the Zone File
By convention, the zone file resides in the/etc/bind directory and is usually named with a db. prefix followed by the domain name. Open both the configuration file and the zone file for editing with the following commands:
- The TTL (Time To Live) value is set to 300 seconds, which establishes the default caching period for DNS records.
- The SOA (Start of Authority) record declares the primary name server for the zone and includes essential maintenance values such as Serial, Refresh, Retry, Expire, and Negative Cache TTL.
Remember to increment the Serial number each time you update the zone file.
4. Validate and Test the DNS Configuration
Even with the correct configuration, querying the domain (using a command-line tool likedig) may not yield the expected results if a glue record is missing for the declared name server. Without a proper glue record, queries for ns1.my.kodekloudlab.com might fail, leading to issues with resolving my.kodekloudlab.com.
Run the following command to verify:
If you encounter an NXDOMAIN status, it may be due to the missing glue record for ns1.my.kodekloudlab.com. In the next article, we will discuss how to add this glue record, ensuring your local DNS server resolves the name server correctly.