Default Debian - How to change DNS
#6
The DNS server traditionally ends up in /etc/resolv.conf, with modern-day Debian it's in /var/run/NetworkManager/resolv.conf. Mostly I've removed wi_cd and NetworkManager because they're unreliable.

I've never used a Pihole, just hosts files that trap advertising URLs into 127.0.0.1. ip route is different than DNS, it should show the shortest path to the internet (try typing just route at a terminal). DNS is Domain Name Service, it looks up URLs and converts them to numbers (IP addresses). For Pihole to work though it needs to be in your route, possibly as a gateway, so it filters by redirecting the ad URLs. Several machines can connect to it, you could even tie hostapd to it and make it into a filtered WiFi AP. Then something else needs to be the gateway for the Pihole machine, maybe your real router.

I'm using EasyTether which is an Android app and a Linux program on my Pi. So EasyTether's IP of 192.168.117.1 is my gateway. I manually copied a bunch of ad URLs from a hosts file AdAway set up on my phone, that does the ad blocking. Then i used the scheme at https://pimylifeup.com/raspberry-pi-wire...ess-point/ which uses hostapd, dnsmasq and iptables so my WiFi network is on 192.168.1.0/24. And this Pi serves internet over WiFi to the whole house.

A decent free public DNS server is 8.8.8.8 which is run by Google. But machines on your network probably want to use the machine with dnsmasq because when it hands out an IP to a DCHP request it will also put that machine's hostname and IP into its DNS cache. So you can hit your local machines with a URL like http://upstairs/index.html. Ssh and ftp amongst your local machines works very nicely using machine hostnames instead of IP addresses or maintaining hosts files like with static IPs.


Messages In This Thread
Default Debian - How to change DNS - by cocozozo - 02-14-2020, 07:41 PM
RE: Default Debian - How to change DNS - by ab1jx - 02-18-2020, 12:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Official Debian support moonwalkers 64 75,053 07-08-2024, 01:40 PM
Last Post: Humid Stylus
  Debian on Pinebook Pro u974615 7 4,440 03-31-2024, 10:11 AM
Last Post: u974615
  Nethunter default password failed lamlarryyyy 0 1,365 11-23-2023, 02:48 AM
Last Post: lamlarryyyy
  install debian on pbp jsch 7 6,706 11-22-2023, 04:22 PM
Last Post: TRS-80
  How to mainline kernel on daniel thompson's debian installer? hellojack 14 12,199 09-07-2023, 09:38 PM
Last Post: Der Geist der Maschine
  Unable to install Debian Bullseye because of missing wifi firmware Pino64 7 6,975 07-15-2023, 02:58 PM
Last Post: u974615
Question Debian (Vanilla) no output on display after Kernel update (6.0.8-1) as365n4 1 2,127 12-09-2022, 12:43 PM
Last Post: as365n4
  Unsuccessful using danielt's unofficial Debian installer on the PBP joeDoe 2 3,542 12-09-2022, 05:04 AM
Last Post: ndp
  How can I install Debian? ImmyChan 1 3,489 10-19-2022, 03:09 AM
Last Post: alpopa
  when i close my laptop lid the screen doesn't turn on? (debian bullseye based) computerc 3 3,245 09-23-2022, 08:37 PM
Last Post: computerc

Forum Jump:


Users browsing this thread: 1 Guest(s)