# Wireguard DNS Search Domain not showing up in /etc/resolv.conf

**URL:** <https://forum.pritunl.com/t/wireguard-dns-search-domain-not-showing-up-in-etc-resolv-conf/3744>\
**Category:** Pritunl VPN\
**Tags:** pritunl-client\
**Created:** [March 3, 2026, 3:15am UTC](https://forum.pritunl.com/t/wireguard-dns-search-domain-not-showing-up-in-etc-resolv-conf/3744 "2026-03-03T03:15:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![macsire](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/m/8e7dd6/32.png) [@macsire](https://forum.pritunl.com/u/macsire)\
**Post date:** [March 3, 2026, 3:15am UTC](https://forum.pritunl.com/t/wireguard-dns-search-domain-not-showing-up-in-etc-resolv-conf/3744/1 "2026-03-03T03:15:34Z")

</div>

I know this has been talked on before @zach with [v1.3.4220.57](https://github.com/pritunl/pritunl-client/releases/tag/1.3.4220.57) but developers are still having issues where the DNS Search Domain is not showing up in our `/etc/resolv.conf` via Wireguard. We are a mix of Windows/MacOS:

- Pritunl client: v1.3.4466.51
- Pritunl VPN: v1.32.4512.98
- MacOS: Tahoe 26.3

I have not tested this out in Windows yet but going to try this out tomorrow. Is this still something that is in the works?

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [March 3, 2026, 4:07am UTC](https://forum.pritunl.com/t/wireguard-dns-search-domain-not-showing-up-in-etc-resolv-conf/3744/2 "2026-03-03T04:07:12Z")

</div>

There’s no reliable way of doing this on Linux that supports all the different DNS systems. It’s generally not recommended to use a DNS search domain. I may develop something for `systemd-resolved` as that has the most reliable API but not something to directly edit `/etc/resolv.conf`.

---

<div class="post-metadata">

**Author:** ![macsire](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/m/8e7dd6/32.png) [@macsire](https://forum.pritunl.com/u/macsire)\
**Post date:** [March 3, 2026, 5:43am UTC](https://forum.pritunl.com/t/wireguard-dns-search-domain-not-showing-up-in-etc-resolv-conf/3744/3 "2026-03-03T05:43:18Z")

</div>

Ya, this is such a pain when it comes to Wireguard. It works in Linux but not MacOS. It’s infuriating. All good. Will try to find a band-aid around this.

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [March 3, 2026, 6:23am UTC](https://forum.pritunl.com/t/wireguard-dns-search-domain-not-showing-up-in-etc-resolv-conf/3744/4 "2026-03-03T06:23:44Z")

</div>

I thought you were referring to Linux, for macOS run `scutil --dns` to check the DNS configuration. I did find the issue for macOS, currently there is a typo setting the DnsServers to the SearchDomains field in [**service/connection/wg.go**](https://github.com/pritunl/pritunl-client/blob/master/service/connection/wg.go#L300). There will be another release this week to fix the Electron window issue so this will be included in that release.

---

<div class="post-metadata">

**Author:** ![macsire](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/m/8e7dd6/32.png) [@macsire](https://forum.pritunl.com/u/macsire)\
**Post date:** [March 3, 2026, 6:34am UTC](https://forum.pritunl.com/t/wireguard-dns-search-domain-not-showing-up-in-etc-resolv-conf/3744/5 "2026-03-03T06:34:22Z")

</div>

Sorry, let me clarify. I will be testing _ **Windows** _ tomorrow. _ **Linux** _ is working just fine. It’s _ **MacOS** _ that is constantly giving me issues with the Search Domain. A temporary fix, which works ONLY if you don’t switch between multiple VPNs, is me running the following commands:

```bash
❯ networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
USB ACM 5
USB ACM 4
USB ACM 3
USB ACM 2
USB ACM
USB3.0 5K Graphic Docking
Thunderbolt Bridge
Wi-Fi
❯ sudo networksetup -setsearchdomains Wi-Fi foo.vpn foo.com

```

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [March 3, 2026, 7:53am UTC](https://forum.pritunl.com/t/wireguard-dns-search-domain-not-showing-up-in-etc-resolv-conf/3744/6 "2026-03-03T07:53:07Z")

</div>

I have reviewed and updated all the DNS code for both OpenVPN and WireGuard. The only issues found on macOS was WireGuard DNS IP address incorrectly set to SearchDomain. Additionaly the primary service SearchDomain will now be backed up on connection and restored when all VPN connections end. The DNS servers don’t require modifying the primary service so these should always get restored.

There is another issue on OpenVPN Linux where the DNS code assumes `systemd-resolved` is in use if the `resolvectl` binary is present. This may be fixed but the recommend fix is to either complete the `systemd-resolved` configuration using the commands below or uninstall `resolvectl`.

```bash
sudo pacman -S systemd-resolvconf
sudo systemctl enable --now systemd-resolved
sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

```

I did additional testing and both DNS IP and search domain configuration should currently be working on Linux and Windows with the latest release. For Linux it will only fully work if `systemd-resolvconf` is used, some of the other DNS services will work with OpenVPN but can have issues. After the next release both DNS IP and search domain configuration should be fixed for macOS.

---

<div class="post-metadata">

**Author:** ![macsire](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/m/8e7dd6/32.png) [@macsire](https://forum.pritunl.com/u/macsire)\
**Post date:** [March 3, 2026, 5:54pm UTC](https://forum.pritunl.com/t/wireguard-dns-search-domain-not-showing-up-in-etc-resolv-conf/3744/7 "2026-03-03T17:54:43Z")

</div>

Windows and Linux works just fine! It’s just darn MacOS. I’ll check this out and await the changes you mentioned for next week.

Thanks again @zach
