AdGuardHome icon indicating copy to clipboard operation
AdGuardHome copied to clipboard

Request to Add Custom Local Domain Support for Private DNS Server

Open MCQSJ opened this issue 1 year ago • 4 comments

Prerequisites

  • [X] I have checked the Wiki and Discussions and found no answer

  • [X] I have searched other issues and found no duplicates

  • [X] I want to request a feature or enhancement and not ask a question

The problem

In the OpenWRT system, I use AdGuard Home to replace the built-in dnsmasq for DNS resolution (AdGuard Home uses port 53, dnsmasq is changed to port 52, and AdGuard Home's Private Reverse DNS Server is set to dnsmasq's port 52). However, the DHCP service is still handled by the original dnsmasq. I have found that local arpa requests can be correctly forwarded to the local dnsmasq for local reverse lookup.

Additionally, OpenWRT has a device domain name feature, which is based on the device name combined with the local domain name in the Network-DHCP/DNS settings, with "lan" as the default. For example, if the device name is "xiaomi-14", the local domain name would be "xiaomi-14.lan". I noticed that many local devices request this local domain name in AdGuard Home, but AdGuard Home does not forward these requests to the Private Reverse DNS Server set to dnsmasq's port 52. Instead, it forwards them to an online DNS server, resulting in a large number of resolution failures with response times over 5000+ milliseconds. Additionally, Windows systems often request wpad plus the local domain name, such as the default "wpad.lan", to find the local proxy. These requests are also wrongly forwarded to the online DNS, causing high latency and no results.

Proposed solution

Therefore, I suggest updating the Private Reverse DNS Server feature to be a Private DNS Server. Additionally, alongside the default forwarding of arpa requests, please add an input field where users can input the local domain name (such as the default "lan"). This would ensure that domain names with the suffix ".lan" are also forwarded to the private DNS server, not limited to arpa reverse queries, ensuring functional implementation and normal latency.

Alternatives considered and additional information

No response

MCQSJ avatar Jul 05 '24 23:07 MCQSJ

You can actually setup this in the upstreams directly. I've the same setup than you, but changed the default "lan" in OpenWRT to "home.arpa".

Screenshot 2024-07-09 at 14 31 24

Cebeerre avatar Jul 09 '24 12:07 Cebeerre

实际上,您可以直接在上游进行设置。我的设置和你一样,但将OpenWRT中的默认“lan”更改为“home.arpa”。

Screenshot 2024-07-09 at 14 31 24

I tried your method. I set the local domain to "home.lan" and the local server to "/home.lan/". After configuring AdGuard Home, I was able to successfully ping "xiaomi14.home.lan" and see the resolved result. It correctly returned the IP address with a 1ms delay. Thank you very much for your help.

MCQSJ avatar Jul 09 '24 13:07 MCQSJ

实际上,您可以直接在上游进行设置。我的设置和你一样,但将OpenWRT中的默认“lan”更改为“home.arpa”。 Screenshot 2024-07-09 at 14 31 24

I tried your method. I set the local domain to "home.lan" and the local server to "/home.lan/". After configuring AdGuard Home, I was able to successfully ping "xiaomi14.home.lan" and see the resolved result. It correctly returned the IP address with a 1ms delay. Thank you very much for your help.

You can actually just use "/lan/", so whatever is in the next level domains will be sent to the upstream anyway. Great it works for you ... anyway keep in mind that the current RFC recommends using home.arpa instead of lan, there's actually an ongoing discussion on the OpenWRT forums around changing their default ...

Cebeerre avatar Jul 09 '24 13:07 Cebeerre

@MCQSJ, does adding the domain-specific upstream for [/lan/] do the trick?

EugeneOne1 avatar May 29 '25 14:05 EugeneOne1