I have registered a domain name domain.co and have a intranet DNS server (BIND) which is serving the queries. I want this domain and dns to be discoverable by anyone in the network without making any changes on their system.
So, I have another domain example.com where I have added A records pointing ns1.example.com -> 10.10.0.1 and ns2.example.com -> 10.11.0.1
Now I have changed the name servers of domain.co (to ns1.example.com , ns2.example.com)
But when I try to resolve the domain name I get server fault. [Note: the DNS have propagated already]
$ dig stage.domain.co
; <<>> DiG 9.9.5-3-Ubuntu <<>> stage.domain.co
;; global options: +cmd
;; connection timed out; no servers could be reached
But dig stage.domain.co @ns1.example.com returns properly.
$ dig stage.domain.co @ns1.example.com
; <<>> DiG 9.9.5-3-Ubuntu <<>> stage.domain.co @ns1.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17613
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 3
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;stage.domain.co. IN A
;; ANSWER SECTION:
stage.domain.co. 86400 IN A 10.11.8.35
It works if I update /etc/resolv.conf to point to my dns server and everything works. What I want to achieve is it work normally without any change in the resolv.conf machines in my network can directly query my intranet dns server.
Why does it throws server-fault when directly querying for the domain name? Is it because its intranet ip ? I want those to be resolvable to my intranet machines only.
EDIT : Figured out the reason, as falcon suggested, local systems do not recursive resolve the dns rather query provider provided recursive dns resolvers ( like google dns/open dns) and they will not be able to access the intranet nameserver, hence it fails. It works when a local recursive dns resolver is deployed and used as dns source.