Fix Wired Connections are Not Connected with Pi-hole DNS

Here is the Guide to Fix Wired Connections are Not Connected with Pi-hole DNS in Ubuntu.

I am using Pi-Hole DNS with Wireguard VPN Tunnel

I setup My Own VPN By Using Cloud VPS + Wireguard (For Secure VPN) + PI-hole (AdBlocker DNS)

After all, set up, it works well on My all devices but I Noticed Pi-hole DNS Block Ads only on the Wireless Devices, not in Wired Devices.

Wired Devices using the DNS which was Added by System Network Manager I have no idea why this issue happening after visiting all Linux Forums I came with this idea.

Stop the Network Manager to adding DNS Servers Dynamically and Add the Pi-hole DNS on DNS Resolver this Solution work perfectly for me Now it blocked the ads and Trackers on the Wired Devices.

Why this issue was Happen?

For me, it took 24 hours to find this issue 🙈 Later I check the wg0 Systemd service status

sudo systemctl status wg-quick@wg0

Jun 05 19:09:29 groot-galaxy wg-quick[8871]: /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf

it using a resolvconf Framework to insert the DNS but My system using the NetworkManager it Gets the DNS From My Router so it automatically generates the resolv.conf file with the Router DNS.

Fix Wired Connections are Not Connected with Pi-hole DNS

  • Open the NetworkManager conf file on your Ubuntu System
nano /etc/NetworkManager/NetworkManager.conf
  • Add this Below line on the Conf File (in [main] section)
[main]
dns=none
  • Save the Settings and Restart the Network Manager
systemctl restart NetworkManager.service
  • Next Open the DNS Resolver conf file and add the Pi-hole DNS
nameserver <Pi-hole DNS>
nameserver 1.1.1.1
  • Save it and Restart the DNS
systemctl restart NetworkManager.service
  • Now restart the Pi-hole server & Start the VPN on your System Hmm Now the ad’s are Blocking Perfectly in My Wired System

Note: Back up your all DNS related Configuration Before Updating the Network related Settings

From the Editor’s Desk

if you’re using Different Operating System Add the DNS Manually and Check it

I hope this Method will help you to solve the DNS Connection issue.

Reference

 

by Team sanweb
Blogger - Web developer - Open Source Lover

Leave a Comment