# VPN Client DNS Mapping

**URL:** <https://forum.pritunl.com/t/vpn-client-dns-mapping/852>\
**Category:** Pritunl VPN\
**Tags:** pritunl\
**Created:** [March 14, 2023, 12:40pm UTC](https://forum.pritunl.com/t/vpn-client-dns-mapping/852 "2023-03-14T12:40:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anekos](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/a/8e7dd6/32.png) [@anekos](https://forum.pritunl.com/u/anekos)\
**Post date:** [March 14, 2023, 12:40pm UTC](https://forum.pritunl.com/t/vpn-client-dns-mapping/852/1 "2023-03-14T12:40:35Z")

</div>

We want to use the client DNS mapping feature to be able to resolve our servers internally.

Can you advise what is missing from the steps below to troubleshoot and get the DNS mapping to work?

1. Enable VPN client DNS Mapping from webui and start the vpn server  
 ![image](https://forum-static.pritunl.com/original/1X/0b5e2b1f64b3c5721e93f6eb156878609b3cdaed.png)

2. The users’ dns names are available in the user/organization list  
 ![image](https://forum-static.pritunl.com/original/1X/be43ddcfdc523fc58f72f5ae2713ad348c8157a3.png)

3. Doing a dns lookup for a user’s dns name from a vpn client fails

According to the documentation, the dns service is created automatically when the `dns mapping` option is enabled and should resolve the .vpn dns names and any other requests will be forwarded to public dns servers (this last part works).

Thanks in advance,  
Anestis

---

<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 14, 2023, 12:49pm UTC](https://forum.pritunl.com/t/vpn-client-dns-mapping/852/2 "2023-03-14T12:49:07Z")

</div>

For macOS Ventura this requires running `sudo pritunl set vpn.dns_mapping_push_all false`. The [**Debugging**](https://docs.pritunl.com/docs/debugging-client) documentation has more information.

---

<div class="post-metadata">

**Author:** ![anekos](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/a/8e7dd6/32.png) [@anekos](https://forum.pritunl.com/u/anekos)\
**Post date:** [March 14, 2023, 2:14pm UTC](https://forum.pritunl.com/t/vpn-client-dns-mapping/852/3 "2023-03-14T14:14:57Z")

</div>

Hi Zach,

Thanks for the quick response.  
We are not using macOS, most of our clients run on Linux (Ubuntu).

The issue is not the use of external (public) DNS - this works, but the resolution of the internal `example.organization.vpn`.

Regards,  
Anestis

---

<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 14, 2023, 2:48pm UTC](https://forum.pritunl.com/t/vpn-client-dns-mapping/852/4 "2023-03-14T14:48:37Z")

</div>

The Pritunl Client doesn’t support configuring the DNS server with NetworkManager which is used by Ubuntu. Systemd Resolved used in Fedora is supported. The [**Gnome Client**](https://docs.pritunl.com/docs/gnome-client) will allow configuring the DNS server on Ubuntu.

---

<div class="post-metadata">

**Author:** ![anekos](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/a/8e7dd6/32.png) [@anekos](https://forum.pritunl.com/u/anekos)\
**Post date:** [April 17, 2024, 11:59am UTC](https://forum.pritunl.com/t/vpn-client-dns-mapping/852/5 "2024-04-17T11:59:08Z")

</div>

Hi Zach,

We are using systemd-resolved service for dns:

 ![image](https://forum-static.pritunl.com/original/1X/90b6394350d74b3d4a500269de82f48241c8ddc5.png)

We try to enable the vpn client DNS mapping from the vpn server instance:

 ![image](https://forum-static.pritunl.com/original/1X/762467ec50273adf2df10ed00c3fcdf0ef900351.png)

Our clients run on Ubuntu 22.04 (headless). We got pritunl-client (not electron) installed.

Can you provide a working example of client DNS mapping?  
Or is this not supported for our setup?

Many thanks,  
Anestis

---

<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:** [April 18, 2024, 2:24am UTC](https://forum.pritunl.com/t/vpn-client-dns-mapping/852/6 "2024-04-18T02:24:37Z")

</div>

If the system has systemd-resolved it should work. Refer to [**pritunl/pritunl-client-electron/service/profile/profile.go:361**](https://github.com/pritunl/pritunl-client-electron/blob/master/service/profile/profile.go#L361) for the code that determines if the systemd-resolved start script is used. It will look for the string `systemd-resolved` in `/etc/resolv.conf`. If this is true check the code used for the script and look for errors in the profile log [**pritunl/pritunl-client-electron/service/profile/scripts.go:243**](https://github.com/pritunl/pritunl-client-electron/blob/master/service/profile/scripts.go#L243)
