Wireguard config with DDNS

In the DNS client file you will see


You can replace the hardcoded IP of your destination with you glddns.com address to get your dynamic dns name

Thanks for your sharing.

One other useful trick…

If you take a modified configuration (The “Interface” and “Peer” sections), copy and paste it into a QR code generator, you can make a QR code readable by smartphones with the DDNS server address.

GL-iNet - it would be great to have an option to use the symbolic host name in your QR, config and JSON versions if DDNS is enabled.

1 Like

Wanting to be able to use my own domain name in the wireguard client configs, I managed to track down the location where it could be set just before the QR code is generated.

Use either WinSCP or ssh to go to the /www/src/temple/wgserver directory and edit the index.js file. I recommend using Notepad ++ to edit the .js file with the JSTool plugin. It helps to display the file in a very structured format that is easy on the eyes.

  1. Look for the line: obj.end_point = result.end_point;
  2. Hit enter after the ;
  3. Type in: obj.end_point = “<your.domain.name>:<port_number>”;
  4. Save and exit. Refresh your web page of the router and now when you hit the show configuration icon, and review the plain text info, you should see your domain name therein rather than your resolved public IP

Hoping this could be easily configurable via the awesome GUI rather than getting in under the hood.

1 Like

I would be hesitant to modify the GL.iNet source code because it may break when there is new firmware and/or package updates.

I think you may be able to edit the export config file that is generated and replace the Endpoint value with your domain name afterwards.

Thanks for reviewing the request. For now I’ve replicated the line where the config is being formed and the QR code is just about to be displayed, and replaced the variable with my preferred value. Ideally, it could just as well pick up the builtin DDNS, if its enabled.