I can ping Web, but not browse it — why are the DNS settings failing

bridgedomain-name-systemgatewaynetmaskroute

Update 6 @ 2:56p on Nov 21

I am working on a creating a small network of virtual machines and containers. So far, I am stuck configuring the host though. There is no virtual machine involved in this connection. Though there are two bridges in place.

Just to clarify, this is on bare-metal in a data center. There is no ISP or modem. The hypervisor is not implicated in the path to the Internet. I am running Ubuntu 17.10.

What works and what does not:

  • ping 8.8.8.8 – succeeds
  • ping 213.133.98.98 – succeeds
  • google.com – failure in name resolution
  • web browsing – no internet connection
  • web browsing with firewall disabled – no internet connection
  • host google.com – no servers could be reached
  • NoMachine, remoting into host using – succeeds
  • antivirus – none

ifconfig -a returns:

lxdbr0 broadcast = 0.0.0.0
enp7s0 broadcast = 0.0.0.0
enp7s0 netmask = 255.255.255.255

My conclusion was that netmask = 255.255.255.255 was the immediate problem as it had enp7s0 on a single-address subnet, with no room for a gateway, etc. This was preventing access to DNS services, thus the pattern of failures. But adding static routing to cure that did not restore Internet/WAN access.

I think the contents of /etc/network/interfaces provides most of the other necessary context. Oh, and the fact that netmask on enp7s0 shows as 255.255.255.255 when I run ifconfig -a.

Gateway and broadcast were assigned by my vendor re enp7s0. Using Ubuntu 17.10. I believe I disabled Network Manager.

'# This is /etc/network/interfaces for use on Host
'# The loopback network interface
auto lo
iface lo inet loopback

'# This is the WAN port
auto enp7s0
iface enp7s0 inet static
    address 78.46.80.146
    netmask 255.255.255.224
    network 78.46.80.128
    broadcast 78.46.80.159
    gateway 78.46.80.129
'# static route entry follows, wherein x.x.0.0 is a wildcard
    up ip route add 78.46.0.0/27 via 78.46.80.129 || true
    dns-nameserver 213.133.98.98 
    dns-nameserver 8.8.8.8

'# Virtual bridge on enp6s0 for virtual machine use
auto br0
iface br0 inet static
    address 192.168.122.2
    netmask 255.255.255.0
    network 192.168.122.0
    broadcast 192.168.122.255
'#   gateway 192.168.122.1
    up ip route add 192.168.0.0/16 via 78.46.80.129 || true
    bridge_ports enp6s0
    bridge_stp on
    bridge_maxwait 0
    bridge_fd 0

'# Virtual bridge for container use
auto lxdbr0
iface lxdbr0 inet static
    address 10.36.109.2
    netmask 255.255.255.0
    network 10.36.109.0
    broadcast 10.36.109.255
  '#  gateway 10.36.109.1
    up ip route add 192.168.0.0/16 via 78.46.80.129 || true
    bridge_ports
    bridge_stp on
    bridge_maxwait 0
    bridge_fd 0


/etc/resolv.conf
nameserver 213.133.98.98
nameserver 8.8.8.8


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         78.46.80.129    0.0.0.0         UG    0      0        0 enp7s0
10.36.109.0     0.0.0.0         255.255.255.0   U     0      0        0 lxdbr0
78.46.0.0       78.46.80.129    255.255.255.224 UG    0      0        0 enp7s0
78.46.80.128    0.0.0.0         255.255.255.224 U     0      0        0 enp7s0
78.46.80.129    0.0.0.0         255.255.255.255 UH    0      0        0 enp7s0
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 enp7s0
192.168.0.0     78.46.80.129    255.255.0.0     UG    0      0        0 enp7s0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 br0


ARP
Address                  HWtype  HWaddress           Flags Mask      Iface
78.46.80.129             ether   30:b6:4f:3f:eb:ba   C               enp7s0

Best Answer

The network address is incorrect.

Fix the network address configuration

network 78.46.80.0

should be corrected as follows:

network 78.46.80.128

Your device enp7s0 belongs to the network 78.46.80.128/27 (which begins at 78.46.80.128 and ends at 78.46.80.159 which is broadcast address is defined above correctly).