Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS settings #46

Closed
argoso opened this issue Sep 16, 2021 · 13 comments
Closed

DNS settings #46

argoso opened this issue Sep 16, 2021 · 13 comments
Labels
enhancement New feature or request v2 Will be implemented in version 2

Comments

@argoso
Copy link

argoso commented Sep 16, 2021

Is it possible to allow strings in client DNS conf. That is important because it allows to use DNS search domain option.

DNS = 192.168.1.100, 192.168.1.101, 192.168.1.104
MTU = 1450

to use like
DNS = 192.168.1.100, 192.168.1.101, 192.168.1.104, mydomain.com
MTU = 1450

At least its working with windows wireguard client

@argoso
Copy link
Author

argoso commented Sep 16, 2021

It may be more appropriate to add another field and merge them later in the client configuration
like

Client DNS Servers
192.168.1.100, 192.168.1.101, 192.168.1.104
Client DNS search option:
mydomain.com
Result will be in client.conf
...
DNS = 192.168.1.100, 192.168.1.101, 192.168.1.104, mydomain.com
...

@argoso
Copy link
Author

argoso commented Sep 16, 2021

with macos client it also work

@h44z h44z added the enhancement New feature or request label Sep 16, 2021
@h44z h44z added the v2 Will be implemented in version 2 label Oct 14, 2021
@zyxep
Copy link

zyxep commented Dec 21, 2021

@h44z do you know if wireguard it self on client allows domains like that?
on all 3 types of clients (MacOS, Windows & Linux)

this feature is definitely something i would need at my work so we can route internal hostnames.

@argoso
Copy link
Author

argoso commented Dec 22, 2021

@zyxep Yes it's not wg-portal feature. This is undocumented feature wireguard client configuration itself. Just add you desired search domains to client config DNS line as shown up. That work with win, linux, macos

@zyxep
Copy link

zyxep commented Dec 22, 2021

Great, makes sense that h44z has added it f or enhancement and for v2, so the settings are generated for client configs to download.

I tried the settings on my mac but didn't seem to do any changes on my M1 laptop.

@argoso
Copy link
Author

argoso commented Dec 22, 2021

@zyxep
DNS servers must be company's internal DNS servers, which allows you do recursive query from vpn's subnet.
https://serverfault.com/questions/857800/find-out-which-dns-server-answered-your-query

@zyxep
Copy link

zyxep commented Dec 22, 2021

it is, and i can connect to our internal hostnames if i write the FQDN :)
But my problem is DNS Search.. i couldn't see any changes in /etc/resolv.conf on my mac when adding the hostname(s) to my wireguard client config.

@argoso
Copy link
Author

argoso commented Dec 22, 2021

ok. I see on my intel mac /etc/resolv.conf
it was change'd when I bring up vpn connection
search mycompany.com
nameserver 192.168.1.100
nameserver 192.168.1.101
you cant add hostname, you can add only internal domainname "mycompany.com" as search option.
Maybe M1 wiregard client behave differently.
without domain search option you cant ping by hostname alone "hostname", but only by full domain name "hostname.mydomain.com"
if you add hostname then dns search names incorrectly

@argoso
Copy link
Author

argoso commented Dec 22, 2021

Thanks for sharing! There was not native app for M1 macos, so it's might be a problem to run this thru amd64/x86 emulation. But i confirm that its was working on intel's macos at least with Catalina and Wireguard App version: 1.0.15 (26)

@zyxep
Copy link

zyxep commented Dec 22, 2021

I've just tested it on my old macbook pro 13".. /etc/resolv.conf in Big Sur is not getting updated.
But if i run scutil --dns i see the resolver that i have set and the search domains are being set.

But i couldn't ping internal company hostnames.. little bit weird.
I am also using app version 1.0.15 (26)

@argoso
Copy link
Author

argoso commented Dec 22, 2021

My config file look like:
[Interface]

PrivateKey = ...=
Address = 192.168.27.5/32

DNS = 192.168.1.100, 192.168.1.101, myinternaldomain.home
MTU = 1450

[Peer]
PublicKey = ...=
Endpoint = xxx.xxx.xxx.xxx:51820
AllowedIPs = 0.0.0.0/0
PresharedKey = ...=
PersistentKeepalive = 16

I think you need import changed config to wireguard after manual update DNS line

@argoso
Copy link
Author

argoso commented Dec 22, 2021

@zyxep
First I think this must be some kind of interface metric problem, but osx already sets first priority to vpn interface
But I found this: https://developer.apple.com/forums/thread/670856
You can also make own resolver configuration: https://medium.com/@jamieeduncan/i-recently-moved-to-a-macbook-for-my-primary-work-laptop-7c704dbaff59

arcadie-cracan pushed a commit to arcadie-cracan/wg-portal that referenced this issue Jul 19, 2023
@h44z h44z mentioned this issue Aug 3, 2023
h44z added a commit that referenced this issue Aug 4, 2023
Initial alpha codebase for version 2 of WireGuard Portal.
This version is considered unstable and incomplete (for example, no public REST API)! 
Use with care!


Fixes/Implements the following issues:
 - OAuth support #154, #1 
 - New Web UI with internationalisation support #98, #107, #89, #62
 - Postgres Support #49 
 - Improved Email handling #47, #119 
 - DNS Search Domain support #46 
 - Bugfixes #94, #48 

---------

Co-authored-by: Fabian Wechselberger <wechselbergerf@hotmail.com>
@h44z
Copy link
Owner

h44z commented Apr 2, 2024

v2 now support setting search domains

@h44z h44z closed this as completed Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2 Will be implemented in version 2
Projects
None yet
Development

No branches or pull requests

3 participants