resolv.conf and interfaces setup ok but dns failed

Kernels & Hardware, configuring network, installing services

resolv.conf and interfaces setup ok but dns failed

Postby blinkfish » 2020-09-02 09:19

resolv.conf and interfaces setup ok but dns failed. nslookup www.google.com failed, but when I just start nslookup and input "server 8.8.8.8", www.google.com can be resolved. Please help.

The following is the network config.

setting of /etc/resolv.conf
-------------------------------------------------------------------------------
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameservers 8.8.8.8
nameservers 8.8.4.4
search xxx

-------------------------------------------------------------------------------


setting of /etc/network/interfaces
-----------------------------------------------------------------------------
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 10.111.2.40
netmask 255.255.255.0
network 10.111.2.0
broadcast 10.111.2.255
gateway 10.111.2.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8
dns-nameservers 8.8.4.4
dns-search xxx
-----------------------------------------------------------------------------
blinkfish
 
Posts: 4
Joined: 2020-09-02 09:09

Re: resolv.conf and interfaces setup ok but dns failed

Postby reinob » 2020-09-02 12:51

It's "nameserver" (singular) not "nameservers" (plural).
:)
reinob
 
Posts: 815
Joined: 2014-06-30 11:42

Re: resolv.conf and interfaces setup ok but dns failed

Postby blinkfish » 2020-09-03 04:05

reinob wrote:It's "nameserver" (singular) not "nameservers" (plural).
:)

Thanks a lot.
blinkfish
 
Posts: 4
Joined: 2020-09-02 09:09

Re: resolv.conf and interfaces setup ok but dns failed

Postby p.H » 2020-09-03 13:04

"dns-nameserver" (without s) is used to specify one DNS server address at a time and can be used multiple times.
"dns-nameservers" (with s) is used to specify multiple DNS server addresses at a time.

The resolvconf scripts use both to create "nameserver" lines in /etc/resolv.conf. It is weird that it generates lines with "nameservers".
p.H
 
Posts: 1438
Joined: 2017-09-17 07:12


Return to System configuration

Who is online

Users browsing this forum: No registered users and 19 guests

fashionable