Tuesday, December 16, 2014

domain name system - How to glue records to allow mydomain.com to use ns1.mydomain.com/ns2.mydomain.com?



I have a domain registered with a Directi reseller and I'm attempting to have the domain resolve to a VPS I have recently rented.



I've read about the term "glue record" which I think is required if I want mydomain.com to use nsX.mydomain.com rather than the nameservers of my registrar or hosting.



My registrar however requires me to point my domain to ns1.domaincentral.com etc. before it allows me to manage the records, letting me create nsX.mydomain.com.




I have been given a single IP address with my VPS so I currently have ns1.mydomain.com and ns2.mydomain.com pointing to that IP address.



I feel that the above question is lacking clarity so feel free to ask specific questions in order to gain the information required to solve the problem.


Answer



Additional resource you may need from Directi reseller documents: http://manage.directi.com/kb/servlet/KBServlet/faq580.html and http://manage.directi.com/kb/servlet/KBServlet/faq471.html



You need 2 ips within your VPS and a dns server on it to be able to glue your domain to it or you need a backup dns if you can't get a 2nd ip.



In your DNS server you would have your domain zone where ns1 would point to your main ip and ns2 would point to your 2nd ip and/or slave dns.




Depending on how your registar panel works you would need to first use their panel to create within your domain A record for ns1 @ your_1st_ip and ns2 @ your_2nd_ip or a CNAME to ns2 @ your_slave_dns.



a sample of how it would look like if you had 2 ips is:



; Zone file for mydomain.com
$TTL 86400
@ 14400 IN SOA ns1.mydomain.com. admin.mydomain.com. (
2010081001 ; serial, todays date+todays
86400 ; refresh, seconds
7200 ; retry, seconds

360000 ; expire, seconds
86400 ) ; minimum, seconds

mydomain.com. 14400 IN NS ns1.mydomain.com.
mydomain.com. 14400 IN NS ns2.mydomain.com.

ns1 IN A my_1st_ip
ns2 IN A my_2nd_ip
mydomain.com. IN A my_web_server_ip


localhost.mydomain.com. IN A 127.0.0.1

mydomain.com. IN MX 0 mail.mydomain.com.

mail IN A my_mail_server_ip
www IN A my_web_server_ip
ftp IN A my_ftp_server_ip


and this is how it would look like if your 2nd dns is from somewhere else:




; Zone file for mydomain.com
$TTL 86400
@ 14400 IN SOA ns1.mydomain.com. admin.mydomain.com. (
2010081001 ; serial, todays date+todays
86400 ; refresh, seconds
7200 ; retry, seconds
360000 ; expire, seconds
86400 ) ; minimum, seconds


mydomain.com. 14400 IN NS ns1.mydomain.com.
mydomain.com. 14400 IN NS ns2.mydomain.com.

ns1 IN A my_1st_ip
ns2 IN CNAME ns1.my_slave_dns_from_somewhere_else.com
mydomain.com. IN A my_web_server_ip

localhost.mydomain.com. IN A 127.0.0.1

mydomain.com. IN MX 0 mail.mydomain.com.


mail IN A my_mail_server_ip
www IN A my_web_server_ip
ftp IN A my_ftp_server_ip


Dont forget that you have to restart your DNS server for these to take place and that there is a propagation time once you change your dns within your registar that can take up to 2 days or so.







Another option is to use an outside DNS server like http://www.zoneedit.com/ for example, using Zone Edit all you would have to do is point their main and secondary dns to a CNAME within your domain like:



ns1      IN CNAME   ns12.zoneedit.com.
ns2 IN CNAME ns34.zoneedit.com.


And then use your ns1/ns2.yourdomain.com at your registar to change it, but you must first use zoneedit's dns system to let the changes propagate.


No comments:

Post a Comment