Problem Configuring DNS on ubuntu server running as a virtual machine
After trying for hours and hours, I was finally able to solve the problem and get DNS working. The major problem was the settings of the virtual box machine. Earlier I wasn't paying much attention to them but as suggested by @abdulkadir(see comments), I spent time there and got the success.
network details
network: 192.168.2.0/24
gateway/router : 192.168.2.1
Here is the solution:
first of all network settings for dns server:
network settings on the client machine:
Interface file(DNS side):
named.conf.options file:
named.conf.local file:
forward zone file:
reverse zone file:
Interface file(client side)
This setup worked absolutely fine for me. I would specifically like to mentions that I didn't make any changes to "resolv.conf", "hosts" or "hostnames" file. Some of the sources on the web were suggesting that.
Thanks.
Related videos on Youtube
harshitgupta
Updated on September 18, 2022Comments
-
harshitgupta over 1 year
I am running "ubuntu-14.04-server-amd64" server as a virtual machine via virtual box on my MAC OSX 10.9.X. I am trying to learn how to configure DNS via linux. I crawled websites for continuously for two days but no success.Following are the snapshots of my work.
/etc/network/interfaces looks like:
ifconfig looks like:
named.conf.local looks like:
named.conf.options
domain.com.db looks like:
rev.0.168.192.in-addr.arpa looks like:
resolv.conf looks like:
hosts.png looks like:
while testing it looks like:
I don't know whats wrong with it. Please suggest me something. Any help is appreciated.
-
Lucio almost 10 yearsAm I wrong or you have a trailing dot on file
domain.com.db
on thedomain.com.
line? -
harshitgupta almost 10 yearsyes sir, the dot is there. shouldn't it be there?
-
Lucio almost 10 yearsYou should try without the trailing dot
-
harshitgupta almost 10 yearsit didn't solved it, @Lucio
-
Dan Hibbert almost 10 yearsI don't see the problem jumping out at me. But for stuff like this, the
dig
command is really helpful. If you have bind installed, then you probably already have it. It lets you directly test what a nameserver responds with when a request is made. (you can specify a specific nameserver by using the@
sign, like@8.8.8.8
. -
Dan Hibbert almost 10 yearsIs domain.com something you are using as an example, or the actual address you are using?
-
Abdul Kadir almost 10 yearsI had the same problem figure out. You have configured DNS correctly but the problem with the Network or Subnet mask. your virtual-box IP address is very different network related to your DNS configuration There is some configuration in virtual-box settings. Go to
virtual machine settings
>Select Network
change your NAT settings toInternal Network
. If it does not work then change one by one. You DNS will work for you. -
harshitgupta almost 10 years@Azendale m using domain.com as dummy domain... could use anything.. but used it for the sake of simplicity..
-
harshitgupta almost 10 years@AbdulKadir thanks for the suggestion. I will try that and let you know. But before that I have question for you. By changing NAT to internal network, will the machine be able to access outside network(google)... do I only need one adapter here(currently m using two, one dhcp another static).
-
Abdul Kadir almost 10 years@harshitgupta Yes you can access only your internal network on outside of the network. If you use multiple network on your VM then settings like 'bridge netowkr' for one lan card. or other for another one. may be your desire will fullfil. I dno't know exectly. try it.
-