• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 563
  • Last Modified:

Run a DNS(bind) service on registered domain for name resolution globally

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) like 'xx.xx.xx.xx--->station1.mydomain.net for name resolution but I could not resolve their names.

Many times I installed & configured local dns servers with no publicly registered domain name. 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?
0
Thyagaraj03
Asked:
Thyagaraj03
  • 26
  • 22
2 Solutions
 
upanwarCommented:
There is no such difference between those two. Only difference is that global DNS server runs on public IP and local DNS server runs on private IPs only.

From the configuration point, configuration is same on both the environment.

Please make sure after making changes in your global DNS server, you have restarted service for DNS and you have not made any misatke in syntax while creating the entry.
0
 
Thyagaraj03Author Commented:
I also added 'station.mydomain.com' which points to the DNS sever itself but I could not resolve it when I checked with nslook. One small doubt/info, as a procedure I'll be adding 'domain mydomain.com' & 'nameserver dns-ip-here' in /etc/resolv.conf while doing local dns sever 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.
0
 
upanwarCommented:
Entry in /ect/resolve.conf points our DNS server, It could be our ISPs DNS server or our local bind server. You need to make the sub-domains entry in server where you are running your nameserver.

like when you do nslookup on windows and linux box its give you a IP address from where it has resolved the hostname to IP and give you the IP address for the host.

Like I have searched the info for yahoo.com. Here yahoo's all DNS records are maintained on servers which are in bold letters.

Retrieving DNS records for yahoo.com...

DNS servers
ns3.yahoo.com [121.101.152.99]
ns8.yahoo.com [202.165.104.22]
ns6.yahoo.com [202.43.223.170]
ns5.yahoo.com [119.160.247.124]
ns2.yahoo.com [68.142.255.16]
ns1.yahoo.com [68.180.131.16]
ns4.yahoo.com [68.142.196.63]



Answer records
yahoo.com  SOA server: ns1.yahoo.com
email: hostmaster@yahoo-inc.com
serial: 2011050307
refresh: 3600
retry: 300
expire: 1814400
minimum ttl: 600
 1800s
yahoo.com  A 67.195.160.76 21600s
yahoo.com  A 69.147.125.65 21600s
yahoo.com  A 72.30.2.43 21600s
yahoo.com  A 98.137.149.56 21600s
yahoo.com  A 209.191.122.70 21600s
yahoo.com  MX preference: 1
exchange: n.mx.mail.yahoo.com
 1800s
yahoo.com  MX preference: 1
exchange: a.mx.mail.yahoo.com
 1800s
yahoo.com  MX preference: 1
exchange: b.mx.mail.yahoo.com
 1800s
yahoo.com  MX preference: 1
exchange: d.mx.mail.yahoo.com
 1800s
yahoo.com  MX preference: 1
exchange: e.mx.mail.yahoo.com
 1800s
yahoo.com  MX preference: 1
exchange: f.mx.mail.yahoo.com
 1800s
yahoo.com  MX preference: 1
exchange: g.mx.mail.yahoo.com
 1800s
yahoo.com  MX preference: 1
exchange: h.mx.mail.yahoo.com
 1800s
yahoo.com  MX preference: 1
exchange: i.mx.mail.yahoo.com
 1800s
yahoo.com  MX preference: 1
exchange: j.mx.mail.yahoo.com
 1800s
yahoo.com  MX preference: 1
exchange: k.mx.mail.yahoo.com
 1800s
yahoo.com  MX preference: 1
exchange: l.mx.mail.yahoo.com
 1800s
yahoo.com  MX preference: 1
exchange: m.mx.mail.yahoo.com
 1800s
yahoo.com  NS ns1.yahoo.com 172800s
yahoo.com  NS ns5.yahoo.com 172800s
yahoo.com  NS ns2.yahoo.com 172800s
yahoo.com  NS ns6.yahoo.com 172800s
yahoo.com  NS ns4.yahoo.com 172800s

Authority records



http://network-tools.com/default.asp?prog=dnsrec&host=yahoo.com


If you are running your name server with your ISP then ask them to make the sub-domain's entry in their DNS server.
0
What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

 
Thyagaraj03Author Commented:
So I've to add 'domain mydomain.com' and 'nameserver dns-ip-here' in the resolve.conf file?. Will it affect without network restart?
0
 
upanwarCommented:
yes It will effect without network restart.
0
 
upanwarCommented:
could you please show me your resolve.conf and on the server where you are running your name server, there execute below given command and also show its resolve.conf as well.

# nslookup <your sub domain>
0
 
Thyagaraj03Author Commented:
I took a leave today especially to work on this and I'm sure I checked resolv.conf yesterday and there was only 2 entries for ISP dns ips like
172.x.x.x
172.x.x.x

When I checked with 'nslookup mydomain.net' it properly resolved my DNS ip which is 204.x.x.x
0
 
Thyagaraj03Author Commented:
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
0
 
upanwarCommented:
Could you please go on the box where you are running your name server and in the server add below given entry in top of the file in /etc/resolve.conf.

nameserver 127.0.0.1

and run

# nslookup <your subdonain>

and also execute the below given command and paste the result.

# dig <domain name> SOA

Could please paste your /etc/named.conf or /var/named/chroot/etc/named.conf from your DNS server and also paste the directory listing on below given directory.

# ls -la /var/named/chroot/var/named/

# ls -la /var/named/

Also paste the output of command.

# service named status

All these command needs to be run on your DNS server.
0
 
Thyagaraj03Author Commented:
I got a doubt if it's really possible running dns server on registered domain. Asking because a person said we should add sub domain at the registerer side(as you showed ns3.yahoo.com for yahoo, may be I shoud add a subdomain to this domain). Else he said something I should Delegate my dns to my own server. Just telling this so that you can guide me with multiple ways and no other intention.
I'm back following you, get back here again
0
 
Thyagaraj03Author Commented:
A small progress!!!. As you said I added 'nameserver my-dns-public-ip' in the resolv.conf file. When I did nslookup of the following it resolved properly on DNS server.

nslookup dns-hostname.mydomain.net----(properly resolved)
nslookup mediawiki.mydomain.net----------(properly resolved)

But,

These are resolved only on the DNS cloud server. When I did nslookup from my office it's not resolving.


And even dig resolved fine on DNS server and here is the output of dig: I've edited to avoid security risks,
root@hostname# dig mediawiki.mydomain.net

; <<>> DiG 9.6.1-P2 <<>> mediawiki.mydomain.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57386
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1

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

;; ANSWER SECTION:
mediawiki.mydomain.net. 38400 IN	A	204.200.x.x

;; AUTHORITY SECTION:
mydomain.net.	38400	IN	NS	mediawiki.mydomain.net.
mydomain.net.	38400	IN	NS	Dns-hostname-here.mydomain.net.

;; ADDITIONAL SECTION:
Dns-hostname-here.mydomain.net. 38400 IN	A	204.200.x.x

;; Query time: 0 msec
;; SERVER: 204.200.x.x#53(204.200.x.x)
;; WHEN: Wed May  4 22:25:08 2011
;; MSG SIZE  rcvd: 115

Open in new window

0
 
upanwarCommented:
You can run DNS server on registered domain, I was running the same for almost two years. My website and the DNS server was running on the same server.

WHy you have created an NS recored for your sub-domain.

mydomain.net.      38400      IN      NS      mediawiki.mydomain.net.

I think you should go with below given URL for better understanding of DNS and its records.

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch18_:_Configuring_DNS


Let me explain you as easiest way.

When we register a domain it require a name server record (NS). It could be run anywhere, like you can use your ISPs name server or you can create your own.

In that Name server (NS), all the domain records and sub-domain resides on that Name-server and get resolves.

When we hit for any domain or sub-domain, it go and check for its NS records and then go there and checks for the A record or other respective records and fulfill our request.

Below given URLs will give you better understanding of how DNS works.

http://en.wikipedia.org/wiki/Domain_Name_System

http://technet.microsoft.com/en-us/library/cc772774(WS.10).aspx

http://www.howstuffworks.com/dns.htm
0
 
Thyagaraj03Author Commented:
Yes, you are always right! and I completely accede to your point. When I added 'mediawiki.mydomain.net' as it was not resolving I added a ns record for that(just a trial).
Before I check those links, I want to let you know some more progress. If I do nslookup 'mediawiki.mydomain.net' it resolving but the public ip address show is completely different, not my dns ip address but pointing to my dns server as I checked it on the browser(apache index page) and connect via ssh by 'ssh mediawiki.mydomain.net'.

I added one more host record 'mail.mydomain.net' but it's not resolving and so I added a NS record which you it's not at all related, and again did nslookup but still it's not resolved. But, connecting via ssh and I could access apache2 with http://mail.mydomain.net. Why not resolving with nslookup/dig, wondering?. I still can't believe until I go and check it from my home(of course i'm cheking the dns cloud server from office)
0
 
Thyagaraj03Author Commented:
Hey Anwar, so I added a domain name(host record) for my own dns server ip, what I should do if I want to add host records of other cloud servers which are having static public ip of different network. Different network in the sense, means I created reverse lookup zone with my dns public ip network 204.200.x.x and other cloud server ips are something 172.12.x.x and 204.52.x.x. I want to add some host records for this cloud servers like the one below,
station1.mydomain.net
station2.mydomain.net
0
 
upanwarCommented:
First of all my name is Umesh Panwar.

If it is a same domain for which you want to add a host record than in the zone file create entries like given below.

station1.mydomain.net          A       172.12.x.x
station1.mydomain.net          A       204.52.x.x.

Then restart the bind service.

If it is a different domain name then create a zone file for it and make the entry for the same in named.conf like you already have for your current domain working domain.
0
 
Thyagaraj03Author Commented:
Extremely sorry! probably I completely changed your caste.

I am wondering how to add a reverse lookup and I added reverse lookup zone of my DNS public ip network(204.200.x.x), will it allow me to add the reverse lookup like this x.x.12.in.addr... to station1.mydomain.net as a reverse lookup zones of networks 172.12.x.x and 204.52.x.x are not created. Will it properly stop and start the bind?. Just wondering...

0
 
upanwarCommented:
You can create separate files for that and then create PTR records for domains and make its entry in named.conf. This is waht I have done.

0
 
upanwarCommented:
Its ok. I dont belive is castism so no need to feel sorry.
0
 
Thyagaraj03Author Commented:
It gave me a good hand. I'm at home now and its not resolving any of the address other than 'mydomain.net'. I'm surprised how it connected from my office and confused now why it's not from my home.
0
 
Thyagaraj03Author Commented:
Wait... I could access the domains on the browser if I add 'nameserver DNS-ip-here' entries in resolv.conf at my home. Can't I do this without changing resolve.conf file?
0
 
upanwarCommented:
It takes time to reflect the DNS changes globally. I would suggest you to wait till morning and then check, It should work without modified resolve.conf
0
 
Thyagaraj03Author Commented:
The domain 'dns-hostname.mydomain.net' is long ago added and 'mediawiki.mydomain.net' is added yesturday and still I could not access them on the browser without adding nameserver in the resolv.conf file. I would like to thank you for your interest.
0
 
upanwarCommented:
Do you want to access your 'mediawiki.mydomain.net' from anywhere or you want to access it from some specific machine. If yes then for the time being you can add an entry in /ect/host file to access this site.

Once DNS get propogate globally then you would be able to access the site without modified the resolve.conf and /ect/hosts files.

You can verify that your DNS changes with

http://www.network-tools.com/

Here check DNS record for  'mediawiki.mydomain.net'

and check your URL by proxy sites.

http://proxy.org/

I was using these ways to verify the changes, because sometime DNS changes takes longer time.

0
 
Thyagaraj03Author Commented:
Yes I want to access them from anywhere. There was a entry 'dns-hostname.mydomain.net' in the hosts file and also as a dns host record for a log(1yr). I think there would be some problem....
0
 
upanwarCommented:

Have you checked out the options to test your dns records with network-tools.com

Please paste the output.
0
 
Thyagaraj03Author Commented:
Here is the output of mydomain.net from network-tools
IP address: 204.200.x.x
Host name: mydomain.net

Alias:
mydomain.net
204.200.x.x is from United States(US) in region North America


TraceRoute to 204.200.x.x [mydomain.net]

Hop	(ms)	(ms)	(ms)		     IP Address	Host name
1  	  28 	  0 	  0 	     8.9.232.73	 xe-5-3-0.edge3.dallas1.level3.net  
2  	  1 	  0 	  1 	     4.69.145.204	 ae-4-90.edge2.dallas3.level3.net  
3  	  2 	  1 	  2 	     4.59.36.50	 rackspace-m.edge2.dallas3.level3.net  
4  	  2 	  2 	  2 	     98.129.84.181	 vlan907.core7.dfw1.rackspace.net  
5  	  9 	  8 	  8 	     98.129.84.217	  -  
6  	  2 	  2 	  2 	     204.200.x.x	 intranet.mydomain.com  

Trace complete


Retrieving DNS records for mydomain.net...

DNS servers
dns1.stabletransit.com
dns2.stabletransit.com

Answer records
mydomain.net		SOA	
server:	dns.stabletransit.com
email:	ipadmin@stabletransit.com
serial:	1276057799
refresh:	3600
retry:	300
expire:	1814400
minimum ttl:	300
	3600s
mydomain.net		NS	dns1.stabletransit.com	3600s
mydomain.net		NS	dns2.stabletransit.com	3600s
mydomain.net		A	204.200.x.x	1000s

Authority records

Additional records
dns1.stabletransit.com		A	69.20.95.4	86400s
dns2.stabletransit.com		A	65.61.188.4	86400s

Open in new window


I've edited mydomain name and ip to avoid security risks
0
 
Thyagaraj03Author Commented:
This is how my forward loookup zone looks like, its not a linux system but ubuntu and config files are different and more over I'll be using webmin more often

vim /var/lib/bind/mydomain.net.hosts
$ttl 38400
mydomain.net.        IN      SOA     dns-hostname-here.mydomain.net. system.mydomain.com. (
                        1274175298
                        10800
                        3600
                        604800
                        38400 )
mydomain.net.        IN      NS      dns-hostname-here.mydomain.net.
dns-hostname-here.mydomain.com.mydomain.net.    IN      A       204.200.x.x
dns-hostname-here.mydomain.net.    IN      A       204.200.x.x
mediawiki.mydomain.net.      IN      A       204.200.x.x
mydomain.net.        IN      NS      mediawiki.mydomain.net.
mail.mydomain.net.   IN      A       204.200.x.x
mydomain.net.        IN      A       204.200.x.x
dns-hostname-here.    IN      A       204.200.x.x
mediawiki.      IN      A       204.200.x.x
web.mydomain.net.    IN      CNAME   mydomain.net
web     IN      CNAME   mydomain.net
dns-hostname-here.mydomain.net.    IN      NS      mediawiki.mydomain.net.

Open in new window

0
 
Thyagaraj03Author Commented:
Just giving a  try I've created those many records hoping that won't one work atleast.
0
 
upanwarCommented:
In the network-tools, click on the DNS Records and then enter your sub-domain mediawiki.mydomain.net and click on go then check what you are getting in answer record.
0
 
Thyagaraj03Author Commented:
This is what I got
dns1.stabletransit.com
dns2.stabletransit.com

Answer records
mydomain.net		SOA	
server:	dns.stabletransit.com
email:	ipadmin@stabletransit.com
serial:	1276057799
refresh:	3600
retry:	300
expire:	1814400
minimum ttl:	300
	3600s
mydomain.net		NS	dns1.stabletransit.com	3600s
mydomain.net		NS	dns2.stabletransit.com	3600s
mydomain.net		A	204.200.x.x	1000s

Authority records

Additional records
dns1.stabletransit.com		A	69.20.95.4	86400s
dns2.stabletransit.com		A	65.61.188.4	86400s

Open in new window

0
 
upanwarCommented:
For which domain you have looked for.

Is it the domain "mydomain.net" or your sub-domain "mywiki.mydomain.net"

Please look for your sub-domain
0
 
upanwarCommented:
Also remove . from the end of word mywifi from file /var/lib/bind/mydomain.net.hosts, It do not require . at end.

mail.mydomain.net. (this is fine )

but

mywiki. (this is not fine)
0
 
Thyagaraj03Author Commented:
I checked for my subdomains 'dns-hostname-here.mydomain.net' and 'mediawiki.mydomain.net' and I got the output similar to below



Retrieving DNS records for dns-hostname-here.mydomain.net...
Attempt to get a DNS server for dns-hostname-here.mydomain.net failed: dns-hostname-here.mydomain.net does not exist in the DNS
0
 
Thyagaraj03Author Commented:
I was just trying if that could work and so I added 'mediawiki.' and restarted the bind. I'll remove that if it causes any problem
0
 
upanwarCommented:
I have modified your /var/lib/bind/mydomain.net.hosts

Please modify it like this.


 $ttl 38400
mydomain.net.        IN      SOA     dns-hostname-here.mydomain.net. system.mydomain.com. (
                        1274175298
                        10800
                        3600
                        604800
                        38400 )
mydomain.net.        IN      NS      dns-hostname-here.mydomain.net.
dns-hostname-here.mydomain.com.mydomain.net.    IN      A       204.200.x.x
dns-hostname-here.mydomain.net.    IN      A       204.200.x.x
mediawiki.mydomain.net.      IN      A       204.200.x.x
mail.mydomain.net.   IN      A       204.200.x.x
mydomain.net.        IN      A       204.200.x.x
dns-hostname-here.    IN      A       204.200.x.x
web.mydomain.net.    IN      CNAME   mydomain.net
web     IN      CNAME   mydomain.net




One main Important thing which I have picked that as per the network-tolls outut, Name servers for your domain are.

mydomain.net            NS      dns1.stabletransit.com      3600s
mydomain.net            NS      dns2.stabletransit.com      3600s

Is it the DNS server where you are modifying the DNS changes or its a different DNS server with other service provider?
0
 
Thyagaraj03Author Commented:
they different servers I guess probably it's from the registerers where the domain is purchased
0
 
Thyagaraj03Author Commented:
I removed unnecessary entries as how to edited the mydomain.net.hosts file but still no progress. For me it's only works if I add 'nameserver dns-ip' in the resolve.conf file on the computer from which I try to access from anywhere
0
 
Thyagaraj03Author Commented:
I mean to say how you edited it.
0
 
upanwarCommented:
So you have to add A record for your mediawiki.mydomain.net to that Nameserver or you have to change the Nameserver for your domain in your domain control panel and point them to your Nameserver instead of current name server. dns1.stabletransit.com and dns2.stabletransit.com

0
 
upanwarCommented:
Because when somebody is hitting your domain then query goes to dns1.stabletransit.com and dns2.stabletransit.com, instead of your DNS server so now you have got the reason that why your sub-domain is not getting resolved.

0
 
Thyagaraj03Author Commented:
how could I do that, probably at the registerer side.
0
 
upanwarCommented:
You have to login to your domain control panel with your login details, these you got when you have registered your domain.
After login there you will find option to modify nameserver and once you modify that it will take 48 to 72 hours to propogate the changes.
0
 
Thyagaraj03Author Commented:
Actually I wanted to run my own dns server where I can configure and mange the records. Frankly speaking I don't have the credentials to interact the domain registerer as I'm working as a system analyst for this small company.
0
 
upanwarCommented:
You can manage the records but if you want to make them available then you have change the name server records in your domain and then only it will pick all the record from your local DNS server.

You can ask the guy who has booked the domain, he would have all the info for your domain, you can ask him to change the NS record.


Otherwise there is no any option for the same.
0
 
Thyagaraj03Author Commented:
How could I add the nameserver at the domain registerer side? could you give me any example, like this,

dns1.stabletransit.com             NS          mydomain.net
0
 
upanwarCommented:
From which service provider you have purchased your domain?

Have you got the admin account details for your account to modify NS record for your domain?

Here I have picked a KB from net4domain, It is a domain registration co. This KB will show you how to change a NS record for a domain and what are the things you require for the same.

Till the time you dont have the ID and password to modify your domain settings, all of the effort are useless.

http://kb.net4.in/?page_id=544

Here go To change Name server [NS]:
0
 
upanwarCommented:
HEre is a video tutorial from ntchosting

http://www.youtube.com/watch?v=yIvC7a_hK00
0
 
Thyagaraj03Author Commented:
Hi Umesh, I'll accept all of your points and I'll assign points after I go home picking your most relevant posts.

If you have time, please join to this lin where I have open a new question relating to this post. Thanks a lot!
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

  • 26
  • 22
Tackle projects and never again get stuck behind a technical roadblock.
Join Now