How to enable nameserver recursion?
The DNS resolver will only move onto the other name servers if the first one returns an error (i.e SERVFAIL
) or can't be reached. If the DNS server returns NXDOMAIN
then the resolver considers that the proper answer and won't check the others. NXDOMAIN
is considered a final definitive answer that the requested domain does not exist.
In your case the first namserver is reached and is denying you.
In that namserver's named.conf
you should have something like allow-query { any; };
Or
One solution might be to temporarily change the order of the nameservers in /etc/resolv.conf
& put 8.8.8.8
first
Or
Just to direct dig
to use 8.8.8.8
as the DNS server at command line you can do :
dig @8.8.8.8 google.de
Related videos on Youtube
Gottlieb Notschnabel
Updated on September 18, 2022Comments
-
Gottlieb Notschnabel over 1 year
On Ubuntu 14.04, when I'm performing a
dig google.de
on my machine, I get a
REFUSED
status (reducing to relevant lines):me@machine:~# dig google.de ;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 26926 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; WARNING: recursion requested but not available
My
/etc/resolv.conf
knows three nameservers:nameserver 1.2.3.4 nameserver 1.2.3.5 nameserver 8.8.8.8
where the first two are corporate owned nameservers. But at least the last one (
8.8.8.8
) shouldn't return a refused status. So how can I enable recursion so that the last nameserver is considered?-
neuron almost 9 yearsCan you paste the
named.conf
configurations? -
neuron almost 9 yearsYou should have
allow-query { any; };
in that -
Gottlieb Notschnabel almost 9 yearsThere is no
named.conf
on that machine;find / -name "named.conf"
returns nothing... -
neuron almost 9 yearsThat will be there on your nameserver..
-
-
Gottlieb Notschnabel almost 9 yearsThank you! Do I have to restart something after modifying
resolv.conf
(and if yes: how)? -
Wouter Verhelst almost 9 yearsNo, that's not necessary. It will be picked up immediately.
-
Gottlieb Notschnabel almost 9 yearsFunnily I still get the same behaviour. And although
8.8.8.8
is the first nameserver now,dig
still returns;; SERVER: 1.2.3.4#53(1.2.3.4)
... -
YoMismo almost 9 years@Neuron, you can specify a server for lookup in the dig command avoiding modifying files:
dig @8.8.8.8 google.de
-
neuron almost 9 years@YoMismo: Agree, edited my post to include your suggestion