ngoduykhanh / wireguard-ui

Wireguard web interface
MIT License
3.78k stars 464 forks source link

Searchdomain in Gui not possible #541

Open Hirsebrei3 opened 5 months ago

Hirsebrei3 commented 5 months ago

The WG-Doku says that the searchdomain should be appended to the DNS-Serverlist. The Gui is rejecting none-ip-adresses and produces an error. One has to do this by hand in the conf.

nebulosa2007 commented 5 months ago

Please provide the link about search domains in the WG docs and indicate where you are trying to enter this in WG UI. That would really help fix this issue

Hirsebrei3 commented 5 months ago

Thanks for your quick reply and sorry for lack of clearness. As you can see in the picture, the issue is "1234.lan" in "DNS Servers". I didn't find a link, but the manpage says: /------------------------------------------------\ man wg-quick • DNS — a comma-separated list of IP (v4 or v6) addresses to be set as the interface's DNS servers, or non-IP hostnames to be set as the interface's DNS search domains. May be specified multiple times. ------------------------------------------------/ wg-issue

As said, manually editing of config file is functional. One can deploy the searchdomain without needing configuration in resolver on client side (NetworkManager, systemd-networkd, also Windows).

nebulosa2007 commented 5 months ago

As described here, DNS servers must be IPv4 or IPv6 only.

To find out what ip is for 1234.lan you can do this: ping -4 -c1 1234.lan or ping -6 -c1 1234.lan

To add non-IP hostnames, it need to rewrite the validating function

Hirsebrei3 commented 5 months ago

A non-ip-entry in WG is interpreted as the searchdomain. No DNS, ip or something else. Deploying the searchdomain as an ip is usesless. there is a difference between DNS and searchdomain. A typical resolve.conf: /---------------------------------------\ nameserver 192.168.178.1 search mynetwork.lan ---------------------------------------/ This technice is present in all OS'es.

nebulosa2007 commented 5 months ago

I understand what you talking about, just thought that you want set just domainname not IP.

I found this issue #153 - so yes, it's a bug and issue has workaround

Hirsebrei3 commented 5 months ago

Thank you, I know this workaround, but didn't find Nr. 153, sorry.