Portal Home > Knowledgebase > Articles Database > Darn DNS


Darn DNS




Posted by timmyd, 04-08-2010, 05:53 AM
hi im running Bind9 on a centos machine for some time now. but since a changing server do domains continuously change ip address. also does a ping to www.domain.com return a ns2.server_ip_address and when pinging on domain.com (without www.) return a ns1.server_ip_address i am staring at this for days now, reading loads of forums but i dont see where its bugging. your help is very much appreciated. cheerz

Posted by Joe262, 04-08-2010, 07:15 AM
are the A records for @ and www different? Are your ns1 and ns2 in sync with eachother? Another possibility is your local resolver may be caching the answer for www, and not for @ or vice versa. You really havent given much in the way of details, so the best I can offer at this point is speculation.

Posted by shawn_linux, 04-08-2010, 07:26 AM
scripts/killdns domain.com One done set the new zone /scripts/adddns --ip --domain domain.com This should remove any multiple entries and make a clean new zone file.

Posted by timmyd, 04-08-2010, 07:44 AM
i do have rsync, however do i only sync manually yet. this is a sample of one of my hosts files $ttl 38400 @ IN SOA ns1.server.net. root.ns1.server.net. ( 2010040700 10800 3600 604800 38400 ) @ IN NS ns1.server.net. @ IN NS ns2.server.net. @ IN A 11.22.33.44 www IN A 11.22.33.44 localhost.domain.com IN A 127.0.0.1 domain.com. 86400 IN MX 10 mx.domain.com. domain.com IN MX 20 domain.com *.domain.com. IN A 11.22.33.44 in the hosts file i says: 127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 and the resolv.conf is something that freaks me out. i tried pointing them to my dns server ips but than a command like host google.com returned nothing, also my yum updates starting to get problems. after putting back the ips that stood there initially made this problem go away. in resolv.conf i have something like search ns1.server.net nameserver 88.77.111.123 nameserver 88.55.222.123 the first ip looks a bit like my ip, so i can be the providers gateway i presume. the second one i have no clue... about the caching thing, i have no idea what ur talking about

Posted by timmyd, 04-08-2010, 07:51 AM
to make it complete on the ns2.server.net the host file for the same domain holds: $ttl 38400 @ IN SOA ns2.server.net. root.ns2.server.net. ( 2010040700 10800 3600 604800 38400 ) @ IN NS ns1.server.net. @ IN NS ns2.server.net. @ IN A 11.22.33.22 www IN A 11.22.33.22 localhost.domain.com IN A 127.0.0.1 domain.com. 86400 IN MX 10 mx.domain.com. domain.com IN MX 20 domain.com *.domain.com. IN A 11.22.33.22 where 11.22.33.22 is the ip for ns2 and 11.22.33.44 is the ip for ns1

Posted by Sileep Kumar M S, 04-08-2010, 09:42 AM
Change your local resolvers to OpenDNS and try a dig: and Shows different A records?

Posted by timmyd, 04-08-2010, 11:51 AM
yes, it looks like [root@ns1 ~]# dig domain.com A ; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 <<>> domain.com A ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57847 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2 ;; QUESTION SECTION: ;domain.com. IN A ;; ANSWER SECTION: domain.com. 38400 IN A 11.11.111.111 ;; AUTHORITY SECTION: domain.com. 38400 IN NS ns1.server.net. domain.com. 38400 IN NS ns2.server.net. ;; ADDITIONAL SECTION: ns1.server.net. 27499 IN A 11.11.111.111 ns2.server.net. 27499 IN A 22.22.222.222 ;; Query time: 4 msec ;; SERVER: 33.33.333.333#53(33.33.333.333) ;; WHEN: Thu Apr 8 15:40:58 2010 ;; MSG SIZE rcvd: 126 [root@ns1 ~]# dig www.domain.com A ; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 <<>> www.domain.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18724 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2 ;; QUESTION SECTION: ;www.domain.com. IN A ;; ANSWER SECTION: www.domain.com. 38400 IN A 22.22.222.222 ;; AUTHORITY SECTION: domain.com. 38375 IN NS ns1.server.net. domain.com. 38375 IN NS ns2.server.net. ;; ADDITIONAL SECTION: ns1.server.net. 27474 IN A 11.11.111.111 ns2.server.net. 27474 IN A 22.22.222.222 ;; Query time: 2 msec ;; SERVER: 33.33.333.333#53(33.33.333.333)

Posted by Joe262, 04-08-2010, 04:07 PM
I take it from your replies that: 1. your nameservers do not stay in sync with eachother automatically 2. they give different replies to the same query If thats the case, then yeah of course you will get weird results. Your primary and secondary nameservers need to be in agreement with eachother. As for my earlier comment about caching. When a user performs a lookup on a domain, their resolver will generally cache the answer it receives from your authoritative nameserver for a period of time. this time frame is called the ttl. To fix your currently broken setup: 1. make sure both your nameservers are giving the same answer. 2. make sure that answer is the right answer 3. get rid of those wildcard A records.

Posted by foobic, 04-08-2010, 07:11 PM
One problem that's often missed is that even with domain.com set up perfectly correctly, if the DNS for server.net is wrong you're still in big trouble. Are those (before anonymization) the correct nameserver IP addresses for the new server? If so, also check you get the right answers from your own nameservers: (You can also use this to query your own nameservers directly for domain.com and www.domain.com, of course)

Posted by Sileep Kumar M S, 04-10-2010, 07:05 AM
To check the nameserver sync issue, you may try dig @both nameservers separately, like If it shows different results for ns1.server.net and ns2.server.net, then there is a sync issue.

Posted by Xous, 04-10-2010, 07:10 AM
Hi, Just provide the actual domain the name-servers IP addresses and we will be able to tell you exactly what is wrong.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Secure my mail server (Views: 635)
Thumbnail help?? (PHP) (Views: 865)
Westnic (Views: 635)

Language: