# Local DNS set from UI only works periodically

**URL:** https://discourse.pi-hole.net/t/local-dns-set-from-ui-only-works-periodically/46460
**Category:** docker
**Created:** [April 21, 2021, 2:49am UTC](https://discourse.pi-hole.net/t/local-dns-set-from-ui-only-works-periodically/46460 "2021-04-21T02:49:53Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)
#### Post date: [April 22, 2021, 6:58am UTC](https://discourse.pi-hole.net/t/local-dns-set-from-ui-only-works-periodically/46460/6 "2021-04-22T06:58:51Z")

</div>

I'm not sure how to handle those things in docker, but on bare metal you can add a file in `/etc/dnsmasq.d/` and specify a particular domain and to which server it should be forwarded.

See the `-S, --local, --server=` sectin here

> **[Man page of DNSMASQ](https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html)**

and here for an example

> [@Choose custom DNS depending on DNS request](https://discourse.pi-hole.net/t/choose-custom-dns-depending-on-dns-request/36142/9):
>
> Thanks!!! In fact thanks to everyone on this thread. It works! The solution for anyone else who wants to do this (my main dns opendns family blocks all vpn requests) : Workout what the main domain is you want to allow. In my case it always has surfshark.com in it, even if the subdomain varies per country. Create a config file as root on your pihole in /etc/dnsmasq.d. I called it bypass.conf. Enter the domain you want to allow: #adding surfshark bypass server=/surfshark.com/9.9.9.9 9.9.9…

---

_[View the full topic](https://discourse.pi-hole.net/t/local-dns-set-from-ui-only-works-periodically/46460)._
