0

I tried using dig and I got the error in the title.

My /etc/resolv.conf is this

nameserver 67.207.67.2
nameserver 67.207.67.3

nameserver ns1.name.com
nameserver ns2.name.com
nameserver ns3.name.com
nameserver ns4.name.com

The first two are the default digital ocean dns, the other are for my domain registrar.

So I tried to add two cloudflare dns, and the file is this:

nameserver 1.1.1.1
nameserver 1.0.0.1

nameserver 67.207.67.2
nameserver 67.207.67.3

nameserver ns1.name.com
nameserver ns2.name.com
nameserver ns3.name.com
nameserver ns4.name.com

After I did, dig still didn't work.

But if I comment the *name.com nameservers, dig works:

nameserver 1.1.1.1
nameserver 1.0.0.1

nameserver 67.207.67.2
nameserver 67.207.67.3

#nameserver ns1.name.com
#nameserver ns2.name.com
#nameserver ns3.name.com
#nameserver ns4.name.com

The fact is that if I comment these *name.com nameservers, my site goes down after some minutes.

So how can I leave these *name.com nameservers and be able to use dig and nslookup and stuff like that?

2 Answers 2

4

First, only (numeric) IP Addresses should follow nameserver.  You cannot use ns1.name.com, etc.  You are making a basic mistake of configuring your /etc/resolv.conf wrong by using nameserverver ns1.name.com.  You have already managed to fix this by commenting them out.

Second, only 3 nameservers are allowed per /etc/resolv.conf. So any fourth nameserver you add will be ignored. So in your /etc/resolv.conf, nameserver 67.207.67.3 will be ignored.

Quoting from the man pages (resolv.conf(5)):

nameserver   Name server IP address

    Internet address of a name server that the resolver should query, either an IPv4 address (in dot notation), or an IPv6 address in colon (and possibly dot) notation as per RFC 2373.  Up to MAXNS (currently 3, see <resolv.h>) name servers may be listed, one per keyword.  If there are multiple servers, the resolver library queries them in the order listed.  If no nameserver entries are present, the default is to use the name server on the local machine. (The algorithm used is to try a name server, and if the query times out, try the next, until out of name servers, then repeat trying all the name servers until a maximum number of retries are made.)

0

Well my problem was that /etc/resolv.conf had a mistake in it:

nameserver 8.8.8.8
nameserver 8.8.4.4nameserver 127.0.0.53

and so i had to change it to this:

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 127.0.0.53

Try check the contents of your resolv.conf file (BTW, you need to use sudo to edit that file) good luck :)

1
  • 1
    This might be true but it doesn't solve the problem described by the question. See this answer for a correct solution.
    – roaima
    Jun 12 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.