Wireguard Server configuration

Hi,

How can I configure the wg server to use a custom dns (say 192.168.1.2) instead of the 64.x.x.x that it currently does. I know I can update each client manually, but would rather do it once on the server.

Also, I have a dynamic dns that I would like to use I’m lieu of the IP address. Again, I know I can update each client manually, but would like to do it once on server.

I thought the wireguard_server file in /etc/config/ would be the place?

For the future, is this something that you can add to the wg config page ? So that after a new firmware upgrade, one doesn’t have to edit file via ssh?

Thanks!

I don’t create a wireguard server on my router (ar300m) but since I have a running wireguard server on vps with pihole dns on all clients, things that need to be done are:

  • Configure dns server to listen to wireguard interface. I am not sure which dns you are going to use, so you may go to dnsmasq settings, or stubby or dnscrypt etc
  • Test first, use netstat -nlptu
  • You still need to add DNS that point to wg interface in each client.

And about dynamic dns, you could use it in client setting instead of your router IP address and nothing to do in wg server setting about it. Make sure the DDNS is working, that’s it.

Thanks… I do have all of this working ok, but the problem is that when I export a peer configuration file, the DNS specified is something like 64.x.x.x so each peer, I manually change to my pihole’s up.

Similarly with DDns. Works fine, but exported configuration uses IP. I can manually update each peer to use the fqdn, but want it so that the configuration file already has the fqdn. I just don’t know where the config file is to update.

if you find answer please let us know. Im thinking it is hardcoded into the web script when generating the client-scancode/conf/json make for a nice addition to the wireguard server mgmt interface?

1 Like

I’m also hoping for a way to change the setting on the peer config setting. Specifically the the subnet in AllowedIP.

if you want to change it in the client it can be changed in /etc/config/wireguard

Right now my plan is to generate the user accounts in the web front end and then manual change the config texts to have the correct url and subnets.