Categories: Hostripples Featured

How to Configure DNS on Ubuntu Server

How to Configuring DNS on Ubuntu Server.

Bind 9 is the default package for the DNS service on the Ubuntu server and it is pre-installed with the OS.

In case if it is not there you may use the below command to install it.
  apt-get install bind9
/etc/bind is the directory where all the The DNS configuration files resides by default. The primary configuration file is /etc/bind/named.conf .
It has the following files incuded

    “/etc/bind/named.conf.options”
    “/etc/bind/named.conf.local”
    “/etc/bind/named.conf.default-zones”

named.conf.options file allowes you to specifies your ISP provided nameservers

    forwarders {
    192.168.1.1;
    };

In this whole tutorial replace 192.168.1.1 and 192.168.1.2 with the IP Addresses of actual servers.

“/etc/bind/named.conf.local” is the File where you configure the DNS zones . The example is given below
zone “hostripples.com” {
type master;
file “/etc/bind/zones/Hostripples.com.db”;
};

Where as /etc/bind/named.conf.default-zones is configurations for default zones on the server. Normally you are not supposed to make changes here.
Now lets begin with configurtion of the DNS zone for your domain..

Create a sub-directory called zones .
mkdir /etc/bind/zones

Edit the zone file /etc/bind/zones/hostripples.com.db , The default zone file is also present at /etc/bind/db.local you may refer it as well…

    ;
    ; BIND data file for local loopback interface
    ;
    $TTL 1800
    @ IN SOA ns1.hostripples.com. root.hostripples.com. (
    2009121502 ; Serial
    28800 ; Refresh
    7200 ; Retry
    604800 ; Expire
    86400 ) ; Negative Cache TTL
    ;
    @ IN NS ns1.hostripples.com.
    @ IN NS ns2.hostripples.com.
    @ IN A 192.168.1.1
    @ IN AAAA ::1
    www IN A 192.168.1.1
    @ MX 10 mail.hostripples.com.
    mail IN A 192.168.1.1
    ns1 IN A 192.168.1.1
    ns2 IN A 192.168.1.2

Once the file is saved, correct the ownership of zoes folder at /etc/bind

chown root.bind /etc/bind/zones/ -R

Now restart bind9

/etc/init.d/bind9 restart

To verify the settings you may use dig command

dig +short A hostripples.com
    192.168.1.1

    dig +short MX hostripples.com
    10 mail.hostripples.com.

If the dig command is not there you may use the below cmmand to install dig command

apt-get install dnsutils

To tr0uble shoot the DNS configurations you may always refer to the logs /var/log/syslog

named[17901]: zone hostripples.com/IN: sending notifies (serial 2009121502) in the syslog indicates that the configurations are working fine.

 


Vishwajit Kale
Vishwajit Kale blazed onto the digital marketing scene back in 2015 and is the digital marketing strategist of Hostripples, a company that aims to provide affordable web hosting solutions. Vishwajit is experienced in digital and content marketing along with SEO. He's fond of writing technology blogs, traveling and reading.

Recent Posts

WordPress User Roles Explained: A Complete Guide to Permissions

Managing access correctly is one of the most important aspects of running a secure and scalable WordPress website. Managing access…

3 days ago

How to Get More Customer Reviews That Build Trust and Sales?

Customer reviews have become one of the most influential factors in modern buying decisions. Before choosing a product, service, or…

2 weeks ago

Why Micro-Influencers Matter: How Small Creators Drive Higher Engagement and ROI

In today’s digital landscape, consumers trust people more than brands. Traditional ads are often ignored, celebrity endorsements feel scripted, and…

3 weeks ago

2026 SEO Roadmap: Skills Every Digital Marketer Must Have

Introduction: SEO in 2026 Is No Longer Optional—It’s Strategic Search Engine Optimization in 2026 has evolved far beyond keywords and…

3 weeks ago

Website Affirmations for 2026: Build, Grow, and Succeed Online

With 2026 just days away, it’s time to reimagine your website’s future. Hostripples encourages businesses, creators, and entrepreneurs to begin…

1 month ago