How to Set Up Custom Name Servers with BIND9 for Go Daddy Domains
Hello DevOps Enthusiasts,
As a Senior DevOps Engineer, one of the tasks I often encounter is setting up custom name servers. This blog post will guide you through creating custom name servers using BIND9, specifically for domains registered on GoDaddy. This setup grants greater control over DNS configurations, optimizing the performance and reliability of your web applications.
Why Custom Name Servers?
Custom name servers offer several advantages:
Control: Full authority over your DNS settings.
Performance: Tailored optimization for your specific needs.
Branding: Use your own domain for name servers, enhancing your professional image.
Prerequisites
EC2 Ubuntu Server: Ensure you have an EC2 instance running Ubuntu.
Domain Name: A domain registered on GoDaddy.
Basic Knowledge: Familiarity with Linux command line and DNS concepts.
Step-by-Step Guide
1. Install BIND9
Ensure BIND9 is installed on your server. For Debian-based systems, use:
sudo apt update sudo apt install bind9 bind9utils bind9-doc
2. Configure named.conf
Edit the named.conf file, which is the main configuration file for BIND9. The location may vary based on your system.
sudo nano /etc/bind/named.conf
Here's a basic configuration example:
options {
directory "/var/cache/bind";
listen-on { any; };
allow-query { any; };
recursion no; };
zone "
yourdomain.com
" {
type master;
file "/etc/bind/zones/
yourdomain.com
.db";
};
Step 3: Create Zone Files
Create zone files for your domain. Create a new directory to store your zone files:
sudo mkdir /etc/bind/zones
Create a zone file for your domain. For example, if your domain is "yourdomain.com":
sudo nano /etc/bind/zones/
yourdomain.com
.db
Here's a basic example for yourdomain.com.db:
Step 4: Update BIND Service
Restart the BIND service to apply the changes:
sudo service bind9 restart
Step 5: Update Domain Registrar
Log in to your domain registrar's website and navigate to the DNS settings or name server management section. Update the name server information with your custom name servers:
ns1.yourdomain.com (Pointing to your server's IP)
ns2.yourdomain.com (Pointing to your server's IP)
-
Step 6: Verify Configuration
Use tools like
dig
or online DNS lookup tools to verify that your custom name servers are responding to DNS queries. dig @
ns1.yourdomain.com
yourdomain.com
A
nskookup
ns1.yourdomain.com
Replace "yourdomain.com" with your actual domain.
If everything is configured correctly, you should see the correct IP address in the answer section.
Conclusion
Setting up custom name servers with BIND9 for domains registered on GoDaddy can initially seem challenging, but with careful configuration and testing, it becomes manageable. This setup offers full control over your DNS infrastructure, enhancing the performance and reliability of your web services.
Feel free to reach out if you have any questions or need further assistance. Happy networking!
Regards and Best wishes, Vishal