Ubuntu – Run DNS service on registered domain for global name resolution

binddnsresolution

I have a domain name mydomain.net purchased/registered for one of the cloud server(ubuntu) and its pointing to the server(nslookup). I have installed DNS(bind) service with the domain mydomain.net. Now I'm trying to add some host records for other cloud servers(all has static public ip) so that I can access them globally anywhere with the name assigned as host records in the DNS.

I added some hosts(I use webmin to manage DNS) for name and ip resolution but I could not resolve their names.

Many times I installed & configured local dns servers with no publicly registered domain names. But I didn't not understand what the concept behind running DNS for global name resolution. Anybody could tell me here if it's actually possible.

EDIT: 1

I already added the name server like my-dns-hostname-here.mydomain.net for my DNS ip 204.x.x.x and also the host record like the one below for my DNS ip 204.x.x.x

my-dns-hostname-here.mydomain.net
mediawiki.mydomain.net

when I did nslookup of above host records, it didn't resolve them

EDIT: 2

As a procedure I'll be adding domain mydomain.com & nameserver dns-ip-here entries in /etc/resolv.conf while doing local dns server but in the cloud dns server I didn't but the ISP's dns server ips. If I have to change it then probably I may have to restart the cloud server which I couldn't do it as it is one of the production server.

EDIT: 3

Output of dig mydomain.net: I've edited to avoid security issue

; <<>> DiG 9.7.0-P1 <<>> mydomain.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42599
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0

;; QUESTION SECTION:
;mydomain.net.      IN  A

;; ANSWER SECTION:
mydomain.net.   1000    IN  A   204.x.x.x

;; AUTHORITY SECTION:
mydomain.net.   3600    IN  NS  dns1.stabletransit.com.
mydomain.net.   3600    IN  NS  dns2.stabletransit.com.

;; Query time: 239 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Wed May  4 14:29:00 2011
;; MSG SIZE  rcvd: 104

Best Answer

You can find a good explanation about how dns work on wikippedia.

As a simplification, you can look at it like an inverse file system. To discover the IP address for mydomain.net a computer will work in a similar way that to find a file on /net/mydomain. First it must read the root dir to find where id the net dir, in dns land it will have to ask the root servers for .net. Then it will read the net dir to search for mydomain, in dns land it will ask the.net server for mydomain.

Note that this was not a technically correct answer. Filesystems don't work that way, DNS caching and multiple DNS makes name resolving more complicated. But I feel that it is a simple model.

Back to your problem: the .net root dns are saying that the authoritative dns for your domain are dns1.stabletransit.com. and dns2.stabletransit.com.. So when a computer is triying to resolve test.mydomain.net it will ask dns1.stabletransit.com for the test.mydoin.net IP, not your server, and stabletransit doesn't know anything about test.

You have two options:

1) The sensible and easy one. Forget about running your dns server and just add test.mydomain.net to dns1.stabletransit.com. There is likely some option to do it where you bougth the domain.

2) The geek way, great for learning. Delegate your dns to your own server, learn all about dns, find some secondaries (your ISP will likely do it) and have fun. You will have to read quite a lot of documentation and experiment a little. Be sure that you are able to access your domain by IP, you will need it when (not if) something goes wrong.

Related Question