# WireGuard DNS after latest upgrade

**URL:** https://dietpi.com/forum/t/wireguard-dns-after-latest-upgrade/3104
**Category:** Troubleshooting
**Created:** [9 April 2019 11:36 UTC](https://dietpi.com/forum/t/wireguard-dns-after-latest-upgrade/3104 "2019-04-09T11:36:16Z")
**Posts on this page:** 7
**Page:** 2

<div class="post-metadata">

### Author: ![Niwre](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/n/ec9cab/32.png) [@Niwre](https://dietpi.com/forum/u/Niwre)
#### Post date: [30 June 2019 18:44 UTC](https://dietpi.com/forum/t/wireguard-dns-after-latest-upgrade/3104/21 "2019-06-30T18:44:20Z")

</div>

@MichaIng  
Thanks for the hint, the solution is now simple and therefore no problem. 🙂

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [30 June 2019 19:50 UTC](https://dietpi.com/forum/t/wireguard-dns-after-latest-upgrade/3104/22 "2019-06-30T19:50:24Z")

</div>

Niwre  
Great. I also just tested WireGuard client setup and indeed similar to OpenVPN client setup, ip r s 0.0.0.0/0 still shows the correct physical default route + gateway. So good chance that we have a more failsafe main network adapter estimation with v6.26 which solves cases as yours.

---

<div class="post-metadata">

### Author: ![ghettopi](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@ghettopi](https://dietpi.com/forum/u/ghettopi)
#### Post date: [6 August 2019 21:20 UTC](https://dietpi.com/forum/t/wireguard-dns-after-latest-upgrade/3104/23 "2019-08-06T21:20:17Z")

</div>

Hi I’m bumping this MichaIng because I am getting the exact same issue when trying to use Wireguard. As soon as I start the service, I start getting DNS resolving issues.

Please see this thread: [Wireguard + Mullvad. How to?](https://dietpi.com/forum/t/wireguard-mullvad-how-to/3392/1)

Do I have to go through the same steps as the other user? If this issue is similar (seems quite like it is) then I think it is safe to say that the problem is not resolved. I am also using Ethernet. This is my 4th fresh install attempt at getting Wireguard to work…

EDIT: I’ve done my best to retrace the steps you gave the other user.

> sed -n 3p /DietPi/dietpi/.network

```plaintext
eth0

```

Then:

> lsmod | grep wireguard

```plaintext
root@DietPi:/etc/wireguard# lsmod | grep wireguard
wireguard 143360 0
ip6_udp_tunnel 16384 1 wireguard
udp_tunnel 16384 1 wireguard
ipv6 450560 42 wireguard,nf_nat_ipv6

```

> dpkg-reconfigure wireguard-dkms

Finished! Next:

> wg-quick up se3

se3 is the name of the .conf I downloaded, which you can see the contents of in the thread I linked above.

```plaintext
root@DietPi:/etc/wireguard# wg-quick up se3
[#] ip link add se3 type wireguard
[#] wg setconf se3 /dev/fd/63
[#] ip -4 address add 10.64.1.43/32 dev se3
[#] ip link set mtu 1420 up dev se3
[#] resolvconf -a tun.se3 -m 0 -x
Too few arguments.
Too few arguments.
[#] ip -4 route add 8.8.8.8/32 dev se3
[#] ip -4 route add 192.169.0.0/16 dev se3
[#] ip -4 route add 192.170.0.0/15 dev se3
[#] ip -4 route add 192.172.0.0/14 dev se3
[#] ip -4 route add 192.160.0.0/13 dev se3
[#] ip -4 route add 192.176.0.0/12 dev se3
[#] ip -4 route add 172.0.0.0/12 dev se3
[#] ip -4 route add 192.128.0.0/11 dev se3
[#] ip -4 route add 172.32.0.0/11 dev se3
[#] ip -4 route add 192.192.0.0/10 dev se3
[#] ip -4 route add 172.64.0.0/10 dev se3
[#] ip -4 route add 192.0.0.0/9 dev se3
[#] ip -4 route add 172.128.0.0/9 dev se3
[#] ip -4 route add 193.0.0.0/8 dev se3
[#] ip -4 route add 173.0.0.0/8 dev se3
[#] ip -4 route add 11.0.0.0/8 dev se3
[#] ip -4 route add 8.0.0.0/7 dev se3
[#] ip -4 route add 194.0.0.0/7 dev se3
[#] ip -4 route add 174.0.0.0/7 dev se3
[#] ip -4 route add 196.0.0.0/6 dev se3
[#] ip -4 route add 168.0.0.0/6 dev se3
[#] ip -4 route add 12.0.0.0/6 dev se3
[#] ip -4 route add 200.0.0.0/5 dev se3
[#] ip -4 route add 160.0.0.0/5 dev se3
[#] ip -4 route add 0.0.0.0/5 dev se3
[#] ip -4 route add 208.0.0.0/4 dev se3
[#] ip -4 route add 176.0.0.0/4 dev se3
[#] ip -4 route add 16.0.0.0/4 dev se3
[#] ip -4 route add 32.0.0.0/3 dev se3
[#] ip -4 route add 128.0.0.0/3 dev se3
[#] ip -4 route add 64.0.0.0/2 dev se3

```

Then:

> sudo wg show

```plaintext
root@DietPi:/etc/wireguard# sudo wg show
interface: se3
  public key: [i] **removed** [/i]
  private key: (hidden)
  listening port: 47623

peer: [i] **removed** [/i]
  endpoint: 185.213.154.130:51820
  allowed ips: 0.0.0.0/5, 8.0.0.0/7, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/2, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/6, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4, 8.8.8.8/32
root@DietPi:/etc/wireguard#

```

Also check status:

> systemctl status \> [wg-quick@se3.service](mailto:wg-quick@se3.service)

```plaintext
root@DietPi:/etc/wireguard# systemctl status wg-quick@se3.service
   wg-quick@se3.service - WireGuard via wg-quick(8) for se3
   Loaded: loaded (/lib/systemd/system/wg-quick@.service; disabled; vendor prese
t: enabled)
   Active: inactive (dead)
     Docs: man:wg-quick(8)
           man:wg(8)
           https://www.wireguard.com/
           https://www.wireguard.com/quickstart/
           https://git.zx2c4.com/WireGuard/about/src/tools/man/wg-quick.8
           https://git.zx2c4.com/WireGuard/about/src/tools/man/wg.8

```

Ok so it’s connected apparently? Let’s ping:

> ping [google.com](http://google.com)

```plaintext
ping: google.com: Temporary failure in name resolution

```

Ok so what the f#ck?

> sudo nano /etc/resolv.conf

```plaintext
# Generated by resolvconf
nameserver 193.138.218.74

```

Ok so what the hell? It was successfully changed by Wireguard but it’s not working…

Well christ, let’s change “DNS=” to my router! 192.168.2.1

Oh look now we get this with Wireguard running. But no answer. 100% packet loss…

```plaintext
root@DietPi:/etc/wireguard# ping google.com
PING google.com (172.217.168.206) 56(84) bytes of data.
^C
--- google.com ping statistics ---
56 packets transmitted, 0 received, 100% packet loss, time 283ms

```

So I get a little bit further when I make my router the DNS written in the .conf file… But why?

---

<div class="post-metadata">

### Author: ![ghettopi](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@ghettopi](https://dietpi.com/forum/u/ghettopi)
#### Post date: [6 August 2019 23:02 UTC](https://dietpi.com/forum/t/wireguard-dns-after-latest-upgrade/3104/24 "2019-08-06T23:02:33Z")

</div>

Solved!

Solution was to remove everything from AllowedIPs and change it back to 0.0.0.0/0. Now everything works.

For some reason it didn’t kill my local network connection and SSH this time… No idea why it did last time. Maybe fail2ban was to blame? Either way I moved to ufw which I like much more (uncomplicated firewall)

---

<div class="post-metadata">

### Author: ![Niwre](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/n/ec9cab/32.png) [@Niwre](https://dietpi.com/forum/u/Niwre)
#### Post date: [18 October 2019 15:37 UTC](https://dietpi.com/forum/t/wireguard-dns-after-latest-upgrade/3104/25 "2019-10-18T15:37:33Z")

</div>

> [@](#):
>
> @Niwre  
> Great. I also just tested WireGuard client setup and indeed similar to OpenVPN client setup, ip r s 0.0.0.0/0 still shows the correct physical default route + gateway. So good chance that we have a more failsafe main network adapter estimation with v6.26 which solves cases as yours.

@MichaIng After update to 6.26.3 the same problem. The quick workaround has also fixed the problem In this version.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [23 October 2019 16:41 UTC](https://dietpi.com/forum/t/wireguard-dns-after-latest-upgrade/3104/26 "2019-10-23T16:41:53Z")

</div>

Niwre  
Indeed I didn’t manage to add it to v6.26. However another report on GitHub brought back my attention: [https://github.com/MichaIng/DietPi/issues/3175](https://github.com/MichaIng/DietPi/issues/3175)

So its two things: Delay WireGuard service start to after DietPi-Boot, so network has fully setup, and either enhance our network info script to not require adapter “UP” state, or better, use the default route method for WireGuard (replace the sed -n 3p /DietPi/dietpi/.network with ip r s 0.0.0.0/0 | mawk ‘{print $5}’ in wg0.conf.

ip r s default should work as well (clearer/beautiful), but AFAIK this does not yet work on Debian Stretch (?).

---

<div class="post-metadata">

### Author: ![Niwre](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/n/ec9cab/32.png) [@Niwre](https://dietpi.com/forum/u/Niwre)
#### Post date: [24 October 2019 08:03 UTC](https://dietpi.com/forum/t/wireguard-dns-after-latest-upgrade/3104/27 "2019-10-24T08:03:09Z")

</div>

@MichaIng  
Many thanks for your help. I changed the default route method in WireGuard in wg0.conf. At the moment everything works fine.

[Previous page](https://dietpi.com/forum/t/wireguard-dns-after-latest-upgrade/3104.md?page=1)
