WireGuard / wireguard-vyatta-ubnt

WireGuard for Ubiquiti Devices
https://www.wireguard.com/
GNU General Public License v3.0
1.46k stars 68 forks source link

Specifying DNS for each interface #94

Closed razor950 closed 2 years ago

razor950 commented 2 years ago

I have a working site to site setup and I'd like to specify the DNS which would be configured as Site A uses Site B's DNS for all Site B endpoints and viceversa; Site B uses Site A's DNS for all its endpoints but given that the interfaces don't allow for specifying a DNS, I am unsure how to handle this.

I can forward Site A's to Site B's DNS but this doesn't work because it does all traffic rather then the selected traffic.

Could this be revisited #52 or explained if its already possible to configure?

razor950 commented 2 years ago

It isn't as big of a priority as I was able to forward the specific hostname to the dns server @ each site respectfully so its working how I wanted it to work but not having to touch WG configuration.

dulitz commented 2 years ago

"site A uses site B's DNS for all site B endpoints and vice versa"

This confuses me. The client's DNS resolver does not choose a DNS server based on where the endpoint is. How could it? The DNS server tells the resolver where the endpoint is. If you happen to have a resolver that selects a DNS server based on the hostname, then you need to configure the resolver on the client, not anything to do with wireguard.

razor950 commented 2 years ago

well the windows WG client has its DNS set to the DNS of that site and I can use both my internal home dns routes and the sites dns routes as well. So I assume I am correct in how that works since I did nothing to combine the two at all.

FossoresLP commented 2 years ago

@razor950 Sorry for the delay in answering. The DNS option is not part of WireGuard itself (see https://man.archlinux.org/man/wg.8#CONFIGURATION_FILE_FORMAT for the supported options) but instead provided by wg-quick which is not included in this package. You might be able to set this DNS configuration up in EdgeOS but WireGuard itself is not capable of handling this case. I would recommend asking for help on that on the Ubiquiti forums.