1

I have a Centos5 server on internet, say srv1.example.com with IP address say 1.1.1.1.
I have changed the A records example.com, www.example.com and ny.example.com to say 2.2.2.2.

I have not restarted BIND since the server hosts zones for other domains too.

The zone file has the $TTL of 86400.

After changing the A records, I tried nslookup, host, dig commands to see if I could get the IP address 2.2.2.2 for example.com, www.example.com and ny.example.com. However, I am still getting the old IP address, 1.1.1.1

I have even flushed dns cache on client pc but no luck.

Can anyone think of anything that might have gone wrong in changing the A records? Or is there any other step that I still have to perform on the server?

i_ch3ry
  • 7
  • 1
  • 5
  • 1
    Appart the TTL, changes will not apply by magic, you have to restart/reload something. If you don't want to restart bind, did you try "rndc reload" ? – krisFR Dec 12 '13 at 01:43
  • 1
    Also, did you update the serial number? You need to update the serial and reload for Bind to know a file has been changed. – Zoredache Dec 12 '13 at 01:45
  • 1
    You can use `named-checkconf` and `named-checkzone` to verify your changes before restarting bind to be sure it will come back up. – Ladadadada Dec 12 '13 at 01:59
  • I have increased the serial number and ran named-checkconf and named-checkzone. named-checkconf echoed 0 and named-checkzone returned OK which I believe that the two commands completed without any error. Server reload successful. Then I performed rndc reload as root. But the ip address is still the old one... – i_ch3ry Dec 12 '13 at 03:02
  • if you used `nsupdate` to make your changes you wouldn't have this problem. – Red Cricket Dec 12 '13 at 03:59

1 Answers1

2

Your changes will not take effect until you:

  1. Increment the serial in your zone file.
  2. Run rndc reload as root.
Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • Incremented serial in my zone file and performed rndc reload. Reload was successful but the IP address is still the old one. I flushed dns cache on client pc again but still no luck. – i_ch3ry Dec 12 '13 at 03:07
  • On ubuntu, performed `sudo service nscd restart` and then ran command `host -t A example.com` and `host -t A ny.example.com` but still showing the old IP address. – i_ch3ry Dec 12 '13 at 03:16
  • You didn't query your DNS server directly? – Michael Hampton Dec 12 '13 at 03:22
  • @MichaelHampton I just performed `dig @ns1.example.com ny.example.com` and it returned the new IP address. Now should I just wait till the TTL expires? – i_ch3ry Dec 12 '13 at 03:30
  • Yes, that's all. Once the TTL expires you should be fine. If you need to change the DNS records frequently, you might want to lower the TTL. – Michael Hampton Dec 12 '13 at 03:42
  • Does it mean that, currently, all the requests to my domain (when not queried directly to the domains name server) are resolved by some intermediate DNS server from its cache and we have to wait until their cache expires? – i_ch3ry Dec 12 '13 at 03:51
  • 2
    That's how DNS works. See [Why does DNS work the way it does?](http://serverfault.com/q/355887/126632) – Michael Hampton Dec 12 '13 at 03:54
  • Thanks Michael I will wait for changes to be propagated. I would mark this post as solved. – i_ch3ry Dec 12 '13 at 06:31