micahmo / WgServerforWindows

Wg Server for Windows (WS4W) is a desktop application that allows running and managing a WireGuard server endpoint on Windows
MIT License
818 stars 78 forks source link

route wireguard server hosts file #155

Open Mduque10 opened 4 months ago

Mduque10 commented 4 months ago

Hello, this is really wonderful, I have been trying to install wireguard in Windows environments for a long time and there are always errors in routing with nat, and this solves it in a simple way.

On the other hand, my request here is the following: on the Windows server where I install this tool, I also have some private DNS in the hosts file, can I have the clients resolve the server's hosts file first and then other DNS like Google ? This would solve the problem of routing a pair of private DNS. Is this viable? thank you so much

micahmo commented 4 months ago

Hi @Mduque10, thanks for the kind words, I'm glad you have found success with this tool!

can I have the clients resolve the server's hosts file first and then other DNS like Google ?

I would be very happy to be wrong, but I do not believe this is possible. Although you can configure DNS on the server when setting up WS4W, DNS is purely a client-side configuration option. While you can use a DNS server that is on the WireGuard network, it is still performing standard DNS lookups from the client. It is not actually asking the server directly for any info.

The only thing I can suggest is using the same hosts file on each of your clients, or setting up a private DNS server on your WireGuard network.

Again, I'm more than happy to be wrong, but I don't believe what you're asking is specifically possible. Feel free to search around though!