0

Server running as Wireguard and DNS (NextDNS) Server

Hi!

Here's my setup:

Hetzner VPS which is running Wireguard and hosting several clients.

I now want to be able to use the Wireguard IP of the Hetzner server in the config of the clients in order to use the NextDNS Server which is installed on Hetzner.

Wireguard configs can be found here: https://pastebin.com/63PgFmYs

 

Basically all Clients use as DNS the IP of the Server (192.168.88.1).

How did i get it to work?

Changing the nextdns config to this: https://pastebin.com/FTZiL7Aa

I've also manually changed /etc/resolv.conf to "nameserver 127.0.0.1" and restarted the server accordingly. And boom! It works, i can use the server as DNS aswell.

BUUUUT here's my problem:

As soon as i shut down the wireguard interface (wg0) with the command "wg-quick down wg0" on the Hetzenr Server i am not able to curl any website. Seems like the DNS is down.

↓↓

xxxxx:~# curl ifconfig.me
curl: (6) Could not resolve host: ifconfig.me

 

A quick "nextdns status" shows that the service is running.

A quick "nextdns restart" throws out this error:

Error: systemctl restart nextdns.service: signal: killed:

Then doing a "systemctl restart nextdns.service" will solve it sometimes but not always.

 

Is there a way to not have to restart the dns service every time?

 

Thanks in advance!

Reply

null

Content aside

  • 2 yrs agoLast active
  • 359Views
  • 1 Following