DesktopECHO / Pi-Hole-for-WSL1

Ad-blocking DNS server for Windows • Unbound pre-configured • Deployment ready in minutes • Does not require hypervisor/docker
364 stars 54 forks source link

No internet once DNS changed #108

Closed Aetherinox closed 1 year ago

Aetherinox commented 1 year ago

Ran your installer, and Pihole is up.

However, as soon as I change the DNS server to 127.0.0.1, the internet dies. I also tried 192.168.0.55 which is the IP of the computer I'm using that is also hosting the Pihole WSL1 server.

OnJCoOT

I went into the Pihole admin, and checked Google (ESC, DNSSEC) IPv4 and tried again, and then I was only able to access google, all other sites were dead. Initially with a fresh install, none of those were checked and setting the DNS also gave the same result (no internet).

I also noticed in the right side under Upstream DNS Servers, it lists 127.0.0.1#5335

1Mb5R9F

Not sure what I'm doing wrong. As soon as that DNS server is changed, everything just dies, but yet in the query log, I do have entries appearing, but all the reply values are SERVFAIL

S8WpWon

Really like how easy your script is, but I've been tweaking with Pihole for a full two days (had a docker install, and then WSL2, and now yours). I just want it to work lol

In case it helps, went to check the resolv file to see what is listed via

sudo nano /etc/resolv.conf
nameserver 1.1.1.1
nameserver fec0:0:0:ffff::1
nameserver fec0:0:0:ffff::2

And some of the debug outputs

*** [ DIAGNOSING ]: Setup variables
    IPV4_ADDRESS=192.168.0.55/24
    PIHOLE_INTERFACE=eth3
    BLOCKING_ENABLED=true
    QUERY_LOGGING=true
    INSTALL_WEB_SERVER=true
    INSTALL_WEB_INTERFACE=true
    LIGHTTPD_ENABLED=true
    DNSMASQ_LISTENING=all
    CACHE_SIZE=10000
    DNS_FQDN_REQUIRED=true
    DNS_BOGUS_PRIV=true
    PIHOLE_DNS_1=8.8.8.8
    PIHOLE_DNS_2=127.0.0.1#5335
    DNSSEC=false
    REV_SERVER=false

[i] Default IPv4 gateway(s):
     192.168.0.1
   * Pinging first gateway 192.168.0.1...

*** [ DIAGNOSING ]: Discovering active DHCP servers (takes 10 seconds)
   Scanning all your interfaces for DHCP servers
   Timeout: 10 seconds
   Error: Could not bind socket to interface eth3 (Protocol not available)
   Error: Could not bind socket to interface eth4 (Protocol not available)
   Error: Could not bind socket to interface eth5 (Protocol not available)

And I'm not sure how these are configured or setup with your script, but this install seems to have a really large number of network adapters

11: eth0: <> mtu 1500 group default qlen 1
    link/ether 00:d8:61:c6:69:24
22: eth1: <> mtu 1500 group default qlen 1
    link/ether 00:d8:61:c6:69:25
4: eth2: <> mtu 1500 group default qlen 1
    link/ether 38:00:25:ad:56:14
14: eth3: <BROADCAST,MULTICAST,UP> mtu 1500 group default qlen 1
    link/ether 00:d8:61:a4:d3:8d
61: eth4: <BROADCAST,MULTICAST,UP> mtu 1500 group default qlen 1
    link/ether 00:15:5d:26:03:5b
16: eth5: <BROADCAST,MULTICAST,UP> mtu 1500 group default qlen 1
    link/ether 0a:00:27:00:00:10
1: lo: <LOOPBACK,UP> mtu 1500 group default qlen 1
    link/loopback 00:00:00:00:00:00
23: eth6: <> mtu 1500 group default qlen 1
    link/ether 00:ff:11:42:2f:74
72: eth7: <> mtu 1500 group default qlen 1
    link/ether 00:00:00:00:00:00
3: wifi0: <> mtu 1500 group default qlen 1
    link/ieee802.11 38:00:25:ad:56:10
15: wifi1: <> mtu 1500 group default qlen 1
    link/ieee802.11 38:00:25:ad:56:11
9: wifi2: <> mtu 1500 group default qlen 1
    link/ieee802.11 3a:00:25:ad:56:10

eth3 seems to be the network adapter that is the same IP as my local machine I'm trying to connect to Pihole with the IP 192.168.0.55

14: eth3: <BROADCAST,MULTICAST,UP> mtu 1500 group default qlen 1
    link/ether 00:d8:61:a4:d3:8d
    inet 192.168.0.55/24 brd 192.168.0.255 scope global dynamic
       valid_lft forever preferred_lft forever
    inet6 ::ca51:3a81:fed7:29b6/64 scope global dynamic
       valid_lft 3597sec preferred_lft 3597sec
    inet6 ::53:293a:e885:dfe9/128 scope global dynamic
       valid_lft 3597sec preferred_lft 0sec
    inet6 ::11f:2ba6:ab72:3781/128 scope global dynamic
       valid_lft 3597sec preferred_lft 0sec
    inet6 ::c8f:ea50:3dd4:8463/128 scope global dynamic
       valid_lft 3597sec preferred_lft 0sec
    inet6 ::3435:d1a5:f765:b7fe/128 scope global dynamic
       valid_lft 3597sec preferred_lft 0sec
    inet6 ::6d66:1344:481e:7cc4/128 scope global dynamic
       valid_lft 3597sec preferred_lft 0sec
    inet6 ::7152:a603:14fe:46ac/128 scope global dynamic
       valid_lft 3597sec preferred_lft 3597sec
    inet6 ::e9df:9620:284a:e44d/128 scope global dynamic
       valid_lft 3597sec preferred_lft 0sec
    inet6 fe80::b38b:4db4:ee01:d8a5/64 scope link dynamic
       valid_lft forever preferred_lft forever
reynol1 commented 1 year ago

pihole worked a few months without any problem and same issue happened to me. i could not fix, may be windows 10 updates broke it.

Aetherinox commented 1 year ago

Interesting.

I decided to throw up a ZorinOS box last night after this issue, using Virtual Box, just to see if it is the install, or if I've got a bigger problem.

It took about 15 minutes, and I got Pihole up and running, without issue. It's tracking my hostnames properly, blocking from the list properly, and I haven't had a single issue.

So I'm not sure if it's something with the package, or if I've got some sort of weird setting that is just blocking out connections.

UxpyfQO

It would be nice to get it working on WSL1 and not have to keep a Virtual Machine running, but I've messed with it for hours and it just refuses to allow me any access to the internet.

DesktopECHO commented 1 year ago

I also noticed in the right side under Upstream DNS Servers, it lists 127.0.0.1#5335

Recommend you uninstall, then reinstall with PH4WSL.CMD. 127.0.0.1#5335 Is the address of the bundled Unbound server. By default that should be the only upstream DNS server configured. Not sure how the other one got there.

On your Windows box, try querying Pi-hole to make sure it's working. It should return the DNS address for the name specified (in the below example, google.com). You can also try this fron another machine on your network, just replace 127.0.0.1 with the IP of your Windows box on your internal network.

C:\>nslookup
Default Server:  xxx.yyy.zzz
Address:  10.74.0.101

> server 127.0.0.1
Default Server:  localhost
Address:  127.0.0.1

> google.com
Server:  localhost
Address:  127.0.0.1

Non-authoritative answer:
Name:    google.com
Addresses:  142.250.176.206
Aetherinox commented 1 year ago

I'll give it another shot. Originally I did install using PH4WSL1.cmd. Install went smooth, just the issue of no connectivity. However, when I install using a VM, Pihole works great.