I'm looking to set up BIND to return the same IP address for every A record, no matter what the request is. It's working based on the configuration below, however what is not working is that the ns records are not being returned correctly, as is required by some domain registrars.
/etc/named.conf:
zone "." IN {
type master;
file "named.root";
};
/var/named/named.root:
$ORIGIN .
$TTL 1H
@ IN SOA . hostmaster.uafrica.net. ( 20121020 1D 1H 1W 3H );
@ IN NS ns1.uafrica.net.
@ IN NS ns2.uafrica.net.
*. IN A 46.38.178.141
ns1.uafrica.net. IN A 184.106.174.139
ns2.uafrica.net. IN A 31.222.155.45
Querying the nameserver directly using dig:
$ dig @ns1.uafrica.net ubookings.co.za
; <<>> DiG 9.7.3-P3 <<>> @ns1.uafrica.net ubookings.co.za
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46866
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;ubookings.co.za. IN A
;; ANSWER SECTION:
ubookings.co.za. 3600 IN A 46.38.178.141
;; AUTHORITY SECTION:
. 3600 IN NS ns1.uafrica.net. // <b>*The domain is not being returned (only a period)</b>
. 3600 IN NS ns2.uafrica.net.
;; ADDITIONAL SECTION:
ns1.uafrica.net. 3600 IN A 184.106.174.139
ns2.uafrica.net. 3600 IN A 31.222.155.45
;; Query time: 443 msec
;; SERVER: 184.106.174.139#53(184.106.174.139)
;; WHEN: Tue Oct 30 14:41:17 2012
;; MSG SIZE rcvd: 126
It seems the problem might be that only a period is being returned under the AUTHORITY SECTION above (instead of the domain name). Also, doing a dig for the nameserver records does not return the ns records as expected:
dig @ns1.uafrica.net ubookings.co.za ns
; <<>> DiG 9.7.3-P3 <<>> @ns1.uafrica.net ubookings.co.za ns
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39694
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
ubookings.co.za. IN NS
;; AUTHORITY SECTION:
. 3600 IN SOA . hostmaster.uafrica.net. 20121020 86400 3600 604800 10800
;; Query time: 716 msec
;; SERVER: 184.106.174.139#53(184.106.174.139)
;; WHEN: Tue Oct 30 14:43:34 2012
;; MSG SIZE rcvd: 89
Any ideas on how to get bind to return the ns records as part of this wildcard configuration would be very much appreciated (if I create a zone with a specific domain the ns records get returned correctly but I need this to work as a wildcard without having to create specific zones for each domain).