#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    20
    Rep 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?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Location
    Florida
    Posts
    248
    Rep Power
    4
    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.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    20
    Rep 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}
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Location
    Florida
    Posts
    248
    Rep Power
    4
    Looks like it should be ok now for the zone.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    20
    Rep Power
    0

    Thumbs up


    Thanks again for clearing up my understanding of DNS! I really appreciate it.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    20
    Rep 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.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Location
    Florida
    Posts
    248
    Rep Power
    4
    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.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    20
    Rep Power
    0
    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?
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Location
    Florida
    Posts
    248
    Rep Power
    4
    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.
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    20
    Rep 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 ?
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    20
    Rep 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
  22. #12
  23. They're coming to take me away

    Join Date
    Jan 2005
    Location
    Florida
    Posts
    5,105
    Rep Power
    5049
    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!"

IMN logo majestic logo threadwatch logo seochat tools logo