Skip to content

Ubuntu DNS Server for VMware environment

While I was rebuilding my homelab from scratch , I thought that would be a good idea to setup the DNS server for my VMware environment on a Ubuntu server.

So I installed Ubuntu server on a VM and after the installation finished I did a sudo apt-get update && sudo apt-get upgrade  and then installed BIND to configure DNS sudo apt-get install bind9.

Once installed go to /etc/bind and here add the zone in named.conf.local

//

// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include “/etc/bind/zones.rfc1918”;
zone “mdc.local”{
type master;
file “/etc/bind/zones/mdc.local.db”;
};
zone “1.168.192.in-addr.arpa”{
type master;
file “/etc/bind/zones/rev.1.168.192.in-addr.arpa”;
};

Now you need to create the zone files:

mkdir /etc/bind/zones

vim /etc/bind/zones/mdc.local.db

vim /etc/bind/zones/rev.1.168.192.in-addr.arpa 

This is how it should look like:

mdc.local.db

@ 1D IN SOA srv-dns.mdc.local. hostmaster.mdc.local. (
2002022401 ; serial
3H ; refresh
15 ; retry
1w ; expire
3h ; minimum
)
mdc.local. IN NS srv-dns.mdc.local.

srv-dns IN A 192.168.1.10
vcsa IN A 192.168.1.20
esxi01 IN A 192.168.1.17
esxi02 IN A 192.168.1.18
esxi03 IN A 192.168.1.19

rev.1.168.192.in-addr.arpa

@ IN SOA srv-dns.mdc.lab.local. admin.mdc.local. (
2006081401;
28800;
604800;
604800;
86400;
)

IN NS srv-dns.mdc.local
10 IN PTR mdc.local
20 IN PTR vcsa.mdc.local
17 IN PTR esxi01.mdc.local
18 IN PTR esxi02.mdc.local
19 IN PTR esxi03.mdc.local

After you configured these you will have to edit /etc/resolv.conf as well to add your domain name and IP:

nameserver 192.168.1.10
search mdc.local

Now since all the configuration is done you will need to restart BIND using service bind9 restart.

Published inGeneral

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.