iamckn / wireguard_ansible

Ansible scripts for the set up a typical wireguard VPN connection
https://www.ckn.io/blog/2017/11/14/wireguard-vpn-typical-setup/
322 stars 69 forks source link

DNS/unbound not working when using on Ubuntu 18.04 #4

Closed Tr4il closed 5 years ago

Tr4il commented 5 years ago

As you may have noted from my other issue I have been messing around with this project a bit and found that if the ansible scripts are ran from a Ubuntu 18.04 client to an Ubuntu 16.04 server all is well, but running to configure a 18.04 server messes up. DNS won't work, neither from a connected client or a local lookup via unbound-control. Not sure where it goes wrong, I am just getting into linux (and already in over my head I think) but that's what I found.

I know the readme says the scripts are for 16.04 so if you won't be looking into this just close the issue instantly and that'll be that.

Edit: upon further trial and error it seems unbound is accepting and resolving hostnames via unbound-control and dig, but my dns is still leaking if browsing

iamckn commented 5 years ago

The problem with Ubuntu 18.04 is the systemd-resolved service which is listening on port 53 and therefore conflicts with unbound. Below in the solution which has also been added to the readme.

If there is another service listening on port 53, you will have issues with getting DNS resolution working. It is therefore advisable to either disable or change the port of any service already using port 53. An example of this is the systemd-resolved service on Ubuntu 18.04. You should switch off binding to port 53 by editing the file /etc/systemd/resolved.conf as follows:

DNSStubListener=no

Reboot the VPN server and DNS resolution will work as expected.