The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> System Administration
> DNS
|
DNS Template Help -- Adding NS and A Records
Discuss DNS Template Help -- Adding NS and A Records in the DNS forum on Dev Shed. DNS Template Help -- Adding NS and A Records DNS forum discussing issues, servers, and configurations. The Domain Name System (DNS) is what the Internet uses to translate website names into IP addresses.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

May 28th, 2011, 02:31 PM
|
|
Registered User
|
|
Join Date: Mar 2010
Posts: 20
Time spent in forums: 1 h 22 m 54 sec
Reputation Power: 0
|
|
|
DNS Template Help -- Adding NS and A Records
I need some help adding custom NS and A records so that ns1.mydomain.com and ns2.mydomain.com point to my secondary server's ip of xxx.xxx.xxx.xxx while ns3.mydomain.com and ns4.mydomain.com both have NS and A records that point to the current server's IP address.
Here's a DNS template file for my site:
Code:
$TTL 86400
@ IN SOA ns.mydomain.com. {dnsemail} (
{serial} ; Serial, this is dns zone template file..
10800 ; Refresh
1200 ; Retry
86400 ; Expire
86400 ) ; Minimum
mydomain.com. IN NS ns3.mydomain.com.
mydomain.com. IN NS ns4.mydomain.com.
ns.mydomain.com. IN A {dnsip}
ns1.mydomain.com. IN A 209.44.107.250
ns2.mydomain.com. IN A 209.44.107.250
ns3.mydomain.com. IN A {dnsip}
ns4.mydomain.com. IN A {dnsip}
dns.mydomain.com. IN A {dnsip}
dns1.mydomain.com. IN A {dnsip}
dns2.mydomain.com. IN A {dnsip}
mydomain.com. IN A {webip}
mail.mydomain.com. IN A {mailip}
smtp.mydomain.com. IN A {webip}
imap.mydomain.com. IN A {webip}
webmail.mydomain.com. IN A {webip}
ftp.mydomain.com. IN CNAME mydomain.com.
www.mydomain.com. IN CNAME mydomain.com.
mydomain.com. IN MX 10 mail.mydomain.com.
mydomain.com. IN TXT "v=spf1 a mx"
ns1.mydomain.com. IN NS 209.44.107.250
ns2.mydomain.com. IN NS 209.44.107.250
ns3.mydomain.com. IN NS {dnsip}
ns4.mydomain.com. IN NS {dnsip}
{customdns}
* IN A {webip}
This template seems to be working, but I still can't access ns3.mydomain.com through http:// --- the nameservers are resolving. I just recently made these DNS changes, but I doubt it takes longer than 12 hours?
Do you see any problems? Will ns1.mydomain.com and ns2.mydomain.com successfully "redirect" to the secondary server while ns3.mydomain.com and ns4.mydomain.com will point to the current server? All of these entries will act as NS and A, right? Does anything need to be changed?
|

May 28th, 2011, 03:29 PM
|
|
Contributing User
|
|
Join Date: Nov 2010
Location: Florida
Posts: 248
 
Time spent in forums: 3 Days 15 h 26 m 11 sec
Reputation Power: 3
|
|
NS records are for domains, not hosts. The servers ns1, ns2, ns3 and ns4 are all considered hosts and do not need NS records. Just A records. So remove the NS records for the hosts towards the bottom, and add the following:
Code:
mydomain.com. IN NS ns.mydomain.com.
mydomain.com. IN NS ns1.mydomain.com.
mydomain.com. IN NS ns2.mydomain.com.
As for a length of time for a change. If you didn't properly plan the change over, your default ttl is 86400 seconds, or 24 hours. So pretty much any of your records that got cached somewhere won't require an update for at least 24 hours. I'd suggest finishing your SPF statement with a "-all" as well. And lower the minimum value in the SOA down to something at or less than 3 hours. Most servers wont ncache over 3 hours but if it does and you make a mistake on a record, it will be ncached for 24 hours.
|

May 28th, 2011, 07:10 PM
|
|
Registered User
|
|
Join Date: Mar 2010
Posts: 20
Time spent in forums: 1 h 22 m 54 sec
Reputation Power: 0
|
|
Thanks so much for the help CaptPikel!
Does this look right now?
Code:
$TTL 86400
@ IN SOA ns.mydomain.com. {dnsemail} (
{serial} ; Serial, this is www.ehcp.net dns zone template file..
10800 ; Refresh
1200 ; Retry
86400 ; Expire
10800 ) ; Minimum
mydomain.com. IN NS ns.mydomain.com.
mydomain.com. IN NS ns1.mydomain.com.
mydomain.com. IN NS ns2.mydomain.com.
mydomain.com. IN NS ns3.mydomain.com.
mydomain.com. IN NS ns4.mydomain.com.
ns.mydomain.com. IN A {dnsip}
ns1.mydomain.com. IN A 209.44.107.250
ns2.mydomain.com. IN A 209.44.107.250
ns3.mydomain.com. IN A {dnsip}
ns4.mydomain.com. IN A {dnsip}
dns.mydomain.com. IN A {dnsip}
dns1.mydomain.com. IN A {dnsip}
dns2.mydomain.com. IN A {dnsip}
mydomain.com. IN A {webip}
mail.mydomain.com. IN A {mailip}
smtp.mydomain.com. IN A {webip}
imap.mydomain.com. IN A {webip}
webmail.mydomain.com. IN A {webip}
ftp.mydomain.com. IN CNAME mydomain.com.
www.mydomain.com. IN CNAME mydomain.com.
mydomain.com. IN MX 10 mail.mydomain.com.
mydomain.com. IN TXT "v=spf1 a mx -all"
{customdns}
* IN A {webip}
|

May 28th, 2011, 07:51 PM
|
|
Contributing User
|
|
Join Date: Nov 2010
Location: Florida
Posts: 248
 
Time spent in forums: 3 Days 15 h 26 m 11 sec
Reputation Power: 3
|
|
|
Looks like it should be ok now for the zone.
|

May 28th, 2011, 10:27 PM
|
|
Registered User
|
|
Join Date: Mar 2010
Posts: 20
Time spent in forums: 1 h 22 m 54 sec
Reputation Power: 0
|
|
Thanks again for clearing up my understanding of DNS! I really appreciate it. 
|

May 31st, 2011, 02:07 PM
|
|
Registered User
|
|
Join Date: Mar 2010
Posts: 20
Time spent in forums: 1 h 22 m 54 sec
Reputation Power: 0
|
|
Hey, I've got another related question:
What should the following be set to if I have a dynamic IP address?
Code:
$TTL 86400
@ IN SOA ns.mydomain.com. {dnsemail} (
{serial} ; Serial, this is www.ehcp.net dns zone template file..
10800 ; Refresh
1200 ; Retry
86400 ; Expire
10800 ) ; Minimum
Basically, I'm thinking that if my IP changes, I can update {dnsip} to my new IP address. How would I shorten the time it takes for my DNS to be updated? Bind is installed on my server.
|

May 31st, 2011, 02:28 PM
|
|
Contributing User
|
|
Join Date: Nov 2010
Location: Florida
Posts: 248
 
Time spent in forums: 3 Days 15 h 26 m 11 sec
Reputation Power: 3
|
|
|
Lower the $TTL value or explicitly state a value for whatever A record is changing. I have a dynamic ip at home and a website. I have my default ttl set to 60 seconds. This is acceptable since I have hardly any traffic to my site. So my max downtime from me changing a record is a minute. A time to choose is ultimately up to you though. I would highly suggest something much lower than the 86400 that you have at the moment.
|

June 1st, 2011, 09:09 AM
|
|
Registered User
|
|
Join Date: Mar 2010
Posts: 20
Time spent in forums: 1 h 22 m 54 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by CaptPikel Lower the $TTL value or explicitly state a value for whatever A record is changing. I have a dynamic ip at home and a website. I have my default ttl set to 60 seconds. This is acceptable since I have hardly any traffic to my site. So my max downtime from me changing a record is a minute. A time to choose is ultimately up to you though. I would highly suggest something much lower than the 86400 that you have at the moment. |
I'll try that.
Do you use a dynamic DNS service? When ns3.mydomain.com and ns4.mydomain.com change IP addresses, wouldn't the host entries at my registrar (GoDaddy) need to be updated? My domain uses the nameservers of ns3.mydomain.com and ns4.mydomain.com... wouldn't that relinquish any control the registrar would have over my host entries and DNS?
|

June 1st, 2011, 11:42 AM
|
|
Contributing User
|
|
Join Date: Nov 2010
Location: Florida
Posts: 248
 
Time spent in forums: 3 Days 15 h 26 m 11 sec
Reputation Power: 3
|
|
|
I have a dynamic IP that hasn't changed in over 2 years with my cable provider. Although, yes, everytime it changes I have to update with my registrar. Luckily an update takes about 45 minutes to update the glue records. There are ddns services out there but I honestly haven't looked in to them.
|

June 1st, 2011, 02:49 PM
|
|
Registered User
|
|
Join Date: Mar 2010
Posts: 20
Time spent in forums: 1 h 22 m 54 sec
Reputation Power: 0
|
|
My IP changes every 20 days
I'd like to be able to continue to give out NS3.mydomain.com and NS4.mydomain.com to my clients as the nameservers they need to use. How could I do this with DynamicDNS? Would I update the host name addresses at GoDaddy and point them to the DynamicDNS, which points to my server? Would I have to change any DNS settings on the server's end?
This is getting complicated now.
Or, would I have to give out the nameservers as mydomain.dyndns.org  ?
|

July 27th, 2011, 09:28 PM
|
|
Registered User
|
|
Join Date: Mar 2010
Posts: 20
Time spent in forums: 1 h 22 m 54 sec
Reputation Power: 0
|
|
Is the following a valid DNS A entry? If it's not, can you please explain why? My DNS stopped working after I added this line... got rid of it, and it worked again, but I don't see how it could have messed my DNS up.
Code:
www.mydomain.com. IN A myIP
|

July 27th, 2011, 10:44 PM
|
 |
They're coming to take me away
|
|
Join Date: Jan 2005
Location: Florida
|
|
Quote: | Originally Posted by own3mall Is the following a valid DNS A entry? If it's not, can you please explain why? My DNS stopped working after I added this line... got rid of it, and it worked again, but I don't see how it could have messed my DNS up.
Code:
www.mydomain.com. IN A myIP
|
It is, provided you used the format xxx.xxx.xxx.xxx for the IP address. When you say your DNS stopped working, what exactly happened?
__________________
"I don't need to get a life. I'm a gamer. I have lots of lives!"
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|