Search domains with wg-quick
cespare at gmail.com
Thu Jan 24 04:37:20 CET 2019
I use Wireguard in a typical sort of "corp VPN" scenario. I use
wg-quick to bring my wg0 up and down.
What is the best way to add a search domain when my wg0 is up?
After reading the wg-quick source, I came up with this proof of
concept that *does* work on my machine:
PostUp = echo 'search mysite.com' | resolvconf -a tun.search -m 0 -x
PreDown = resolvconf -d tun.search
However, there are some problems:
- That "tun.search" string is just something I made up after seeing
the "tun.wg0" that wg-quick uses. What should I put there?
- I don't even know how the -m 0 -x flags work, or whether they're
necesary. (There was an interesting discussion between Jason and
Lennart Poettering over here, though:
- I guess I need to take some different approach in macOS; some
googling talks about "networksetup -setsearchdomains"?
Anyway, would it be reasonable to teach wg-quick about search domains,
or is doing some kind of PostUp/PreDown stuff going to be my only
BTW in OpenVPN we do this with
push "dhcp-option DOMAIN mysite.com"
push "dhcp-option DNS 126.96.36.199"
More information about the WireGuard