Ubuntu network broken after Pi-hole uninstall - SOLVED

Expected Behaviour:

Normal networking, including bridges, name resolution, systemd units

Actual Behaviour:

IP-based networking works. Name resolution does not. Bridged networking does not. Systemd network unit is non-functional.

Debug Token:

N/A after uninstall.

Hello,

First, I have to say, I love Pi-Hole. Huge fan.

I installed it a while back on my media server at home, but decided to uninstall it once I got it running in Docker.

During the uninstall process, I chose "y" instead of "n" to remove the packages which Pi-Hole installed. Rookie move.

Now, my network is completely smashed.

Name resolution does not work at all, even though I can ping any internal or external DNS server.

auto br0
iface br0 inet static
address 192.168.1.4
netmask 255.255.255.0
gateway 192.168.1.1
bridge_ifaces enp5s0
bridge_ports enp5s0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
dns-nameservers 9.9.9.9

ping 9.9.9.9
PING 9.9.9.9 (9.9.9.9) 56(84) bytes of data.
64 bytes from 9.9.9.9: icmp_seq=1 ttl=59 time=17.5 ms
64 bytes from 9.9.9.9: icmp_seq=2 ttl=59 time=18.3 ms
64 bytes from 9.9.9.9: icmp_seq=3 ttl=59 time=15.5 ms

ping google.com
ping: unknown host google.com

Bridged networking no longer works, so none of my VM's or Docker containers have connectivity.

brctl show
bridge name bridge id STP enabled interfaces

virsh start proxy
error: Failed to start domain proxy
error: Cannot get interface MTU on 'br0': No such device

If I try to issue anything via systemctl, I get: "Failed to restart network.service: Unit network.service not found."

systemctl status network
● network.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)

B/c I cannot connect to anything other than via IP, I cannot re-install Pi-hole to bring back those packages. I cannot update the system or contact the Ubuntu repos.

Reinstallation is not an option.

Any help getting my network back would be REALLY appreciated.

The OS is Ubuntu 16.04.5 LTS (latest updates)

1 Like

To get name resolution working again, check content of below file:

pi@noads:~ $ cat /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
nameserver 127.0.0.1

Change the nameserver field into a public DNS server like for example Google's 8.8.8.8.
If no nameserver lines displayed, add one with 8.8.8.8.
Now you should temporarily have name resolution again until next reboot.
Test with for example:

pi@noads:~ $ host pi-hole.net
pi-hole.net has address 206.189.252.21
pi-hole.net has IPv6 address 2604:a880:400:d0::1071:1
pi-hole.net mail is handled by 10 one.mxroute.com.
pi-hole.net mail is handled by 20 one-relay.mxroute.com.

I assume above output is from the /etc/network/interfaces file ?
Mind that Pi-hole installs the package dhcpcd5 for most all network related configs.
Check if you still have dhcpcd5 installed with:

pi@noads:~ $ apt policy dhcpcd5
dhcpcd5:
  Installed: 1:6.11.5-1+rpt5
  Candidate: 1:6.11.5-1+rpt7
  Version table:
     1:6.11.5-1+rpt7 500
        500 http://archive.raspberrypi.org/debian stretch/main armhf Packages
 *** 1:6.11.5-1+rpt5 100
        100 /var/lib/dpkg/status
     6.10.1-1 500
        500 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages

If installed, you could try remove the package with:

sudo apt remove dhcpcd5

Now you have better luck the settings in /etc/network/interfaces are actually used.
But do mind, some other network manager could be active.

Some pointers for bridging.
Check interface names with:

ip l

To create a bridge called br0:

sudo brctrl addbr br0

To add an interface to the bridge br0:

sudo brctrl addif br0 <INTERFACE_NAME>

And check:

sudo brctrl show

ip l

Am not familiar with your distro but hope these pointers might help a bit.

1 Like

Thanks for the reply, deHakkelaar.

I managed to fix it.

Here's how.

Since I had network, but no name resolution, I just found the IP of my closest mirror, and edited my sources.list file to use the mirror's IP, not FQDN.

I was then able to use apt to install from the web.

Next, I installed a VM of Ubuntu 16.04.5 LTS on my laptop. I then did a dump of all installed files to a text file:

apt list --installed >> installed.txt

I then was able to easily peruse the text file and see what packages I might reinstall, in order to replace what was possibly missing and to reinstall anything that was 'damaged' on my server.

apt install --reinstall ubuntu-minimal ubuntu-standard ubuntu-server ifconfig ifupdown netbase netbase net-tools bridge-utils iproute iproute2 dnsutils

I tried to cover as many bases as I could.

This got me 99% of the way there. Everything looked like it should work, but still didnt. My bridge had a DHCP lease and the NIC had br0's static address. So strange. By that time you had replied...

Mind that Pi-hole installs the package dhcpcd5 for most all network related configs.
Check if you still have dhcpcd5 installed

I uninstalled dhcpcd5:

apt remove --purge dhcpcd5

Rebooted, and everything worked fine.

I cant believe it took me nearly a day to simply just replace the mirror's FQDN with its IP. I'm getting old, I guess.

I never would have known to remove dhcpcd5 though, so thanks for that!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.