1

I have configured Stretch networking for eth0 (it picked ens3), after setting:

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
grub-mkconfig -o /boot/grub/grub.cfg
reboot

so now I have:

>: cat /etc/network/interfaces
source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
    address 192.168.1.10/24
    gateway 192.168.1.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 8.8.8.8

which works, so:

>: ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
      valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
      valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:0a:f7:bc brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.10/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe0a:f7bc/64 scope link
       valid_lft forever preferred_lft forever

And I can ping google nameservers like:

>: ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=10.9 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=55 time=10.9 ms

But not google itself, or any other domain. My hosts file looks like:

>: cat /etc/hosts
127.0.0.1   localhost
192.168.1.10    someserver.name.com someserver

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

My resolv.conf looks like:

>: cat /etc/resolv.conf
nameserver 8.8.8.8

but I can ping my gateway so the default route seems okay:

>: ip r
default via 192.168.1.1 dev eth0 onlink
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.10

my /etc/nsswitch.conf says:

hosts:          files dns
networks:       files

What is missing? Should I be doing something else in Stretch?

  • Please show grep hosts /etc/nsswitch.conf in your question – roaima Nov 15 '17 at 23:29
0

It sounds like you may be confusing two issues routing and DNS. If you are able to ping numerical addresses, like <8.8.8.8> or <128.171.224.100> (www.hawaii.edu) then the issue is DNS, not routing.

The /etc/nsswitch.conf file specifies where to look for DNS information, and in what order to make the queries. Look for the line strating with 'hosts'.

  • I wanted to verify routing before chasing down DNS issues. my /etc/nsswitch.conf says hosts: files dns. – batflaps Nov 16 '17 at 0:30
  • I ran host google.com and it returned google.com has address 216.58.193.78 so that works. I tried disabling ipv6 too (someone said that helped) but it didn't help. – batflaps Nov 16 '17 at 0:37
0
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
    address 192.168.1.10/24
    gateway 192.168.1.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 8.8.8.8

Remove the /24. Reasons for this: Syntax wise you're incorrect.

Assuming your 192.168.1.10 address contains a DNS server, removing the /24 should fix your error.

  • the /24 was put there by Stretch installer. I removed the CIDR and put netmask 255.255.255.0 on the next line like Jessie, and it didn't help. The output of ip a is still the same, and looks right or routing wouldn't work I think. – batflaps Nov 16 '17 at 0:41
  • The CIDR syntax is accepted since wheezy at least. And the OP clearly does not run a resolver on the host. – Ferenc Wágner Nov 21 '17 at 14:58

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.