I'm hoping someone can give me a hand getting this configured. I am trying to get BIND to respond a certain way to reproduce a hosted DNS provider's behavior. I'm fairly new to DNS, but I'm hitting a roadblock that I just can't get past.
When I query my hosting provider's DNS servers, the NS record comes back as an Answer record.
# dnsq NS www.example.com ns.host.com 2 www.example.com: 113 bytes, 1+2+0+2 records, response, noerror query: 2 www.example.com answer: www.example.com 3600 NS lb1.example.com answer: www.example.com 3600 NS lb2.example.com additional: lb1.example.com 3600 A 184.108.40.206 additional: lb2.example.com 3600 A 220.127.116.11
When I query my internal BIND server, the NS record comes back as an Authority record.
# dnsq NS www.test.com bind.local 2 www.test.com: 110 bytes, 1+0+2+2 records, response, noerror query: 2 www.test.com authority: www.test.com 3600 NS lb1.test.com authority: www.test.com 3600 NS lb2.test.com additional: lb1.test.com 3600 A 10.254.0.1 additional: lb2.test.com 3600 A 10.254.0.2
The difference ends up changing client behavior in that Authority responses are then queried, but Answer responses are not. (ie. in the second case, ns1.test.com or ns2.test.com is queried to find the "actual" NS record.) This is behavior I would like to avoid. What settings would I change in BIND to have NS records returned as Answer responses?
As requested, here is the relevant sections of the zone file from the hosting provider:
$ORIGIN example.com. @ 86400 IN SOA <omitted> <omitted> 104 28800 450 1209600 900 lb1 3600 IN A 18.104.22.168 lb2 3600 IN A 22.214.171.124 @ 172800 IN NS ns1.host.com. @ 172800 IN NS ns2.host.com. www 3600 IN NS lb1.example.com. www 3600 IN NS lb2.example.com. ns1 86400 IN A <Host's Nameserver> ns2 86400 IN A <Host's Nameserver>
And from my BIND local server:
$TTL 1h test.com. IN SOA ns1.test.com. ns2.test.com. ( 1 ; 10000 ; 3600 ; 86400 ; 3600 ) ; ; Name servers test.com. IN NS ns1.test.com. test.com. IN NS ns2.test.com. ; ; Addresses ns1.test.com. IN A 10.254.0.1 ns2.test.com. IN A 10.254.0.2 lb1.test.com. IN A 10.254.0.101 lb2.test.com. IN A 10.254.0.102 ; ; Delegation www.test.com. IN NS lb1.test.com. www.test.com. IN NS lb2.test.com.
What I am trying to do is delegate www.test.com to a pair of DNS load balancer.
As requested, here is the output of a dig against the hosted DNS provider with recursion off:
# dig +norecurse @ns.host.com www.example.com ns ; <<>> DiG 9.5.1-P2.1 <<>> +norecurse @ns.host.com www.example.com ns ; (1 server found) ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14494 ;; flags: qr; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 2 ;; QUESTION SECTION: ;www.example.com. IN NS ;; ANSWER SECTION: www.example.com. 3600 IN NS lb2.test.com. www.example.com. 3600 IN NS lb1.test.com. ;; ADDITIONAL SECTION: lb2.test.com. 3600 IN A 126.96.36.199 lb1.test.com. 3600 IN A 188.8.131.52 ;; Query time: 88 msec ;; SERVER: 184.108.40.206#53(220.127.116.11) ;; WHEN: Fri Aug 12 12:16:42 2011 ;; MSG SIZE rcvd: 113