Adguardhome: Redirect *.domain.com to a given IP

Created on 8 Aug 2019  路  14Comments  路  Source: AdguardTeam/AdGuardHome

  • [x] I am running the latest version
  • [X] I checked the documentation and found no answer
  • [X] I checked to make sure that this issue has not already been filed

Issue Details

  • Version of AdGuard Home server:
    Docker container version 0.97.1 on Synology NAS, running in Host network mode
  • Operating system and version:
    Synology DSM 6.2

Expected Behavior

In the Custom filtering rules section, I added a line in the following pattern _"192.168.1.100 *.domain.com"_. I then type "nslookup subdomain.domain.com" in a terminal on a client and expect to get "192.168.1.100" as an answer.

Actual Behavior

The AdGuard DNS server does not match my rule and resolves after an external DNS query (in my case tls://1.1.1.1) which of course does not give the intranet IP I would like.

Adding a line _"192.168.1.100 subdomain.domain.com"_ works, but I would need to add dozens of subdomains like this, and will have to do the same when I create more subdomains in the future.

Is there any possibility to add wildcard domains in this list ? Maybe I am not using the right syntax ?

Thanks for your help :)

Medium feature request

Most helpful comment

Thanks for the upvotes, the issue is assigned to v0.101 release now.

All 14 comments

Just for the record, I know that ordinary wildcard blockage with ||*.domain.com^ and *.domain.com is possible, but I personally don't think the AdGuard Home team has decided to expand on the standard Hosts syntax in order to make that kind of entry support wildcards yet.

HOSTS-type records don't support wildcard in domain names. This looks like what you want to get exactly. Not an AGHome issue.

I would like to add an A-type record for a wildcard domain.

For example Synology DNS server package allows to do that, by taking into account the * symbol and correctly redirecting all requests to the chosen IP.

This should be high priority, most people running adguard home at home will have other vm's or dockers running, so this is very useful, in fact is one of the things that keeps me on pihole on which is possible doing some tricks

Guys, please not just comment but also upvote the task

Agreed with increasing the priority here. The only current workaround is setting up a secondary dns server that supports wildcards and forwarding requests for that zone.

Thanks for the upvotes, the issue is assigned to v0.101 release now.

This would be a great feature for Steam cache/lan cache that needs to redirect wildcarded domains. For example this is the list of what domains you need to redirect for caching Steam library. It would be nice if this feature would work in both the "custom filters" field and in the URL downloaded filters.

Thank you for planning on implementing this feature as only workaround now is to setup your DNS as:
Steam Cache/Lan Cache DNS Proxy -> AdGuard Home -> DNS Resolver...

Works like a charm! Thank you very much for implementing this.

Great work @ameshkov !

However it seems that if we set up something like this :

  • *.domain.com -> 192.168.0.10
  • cloud.domain.com -> 192.168.0.11

Then an nslookup cloud.domain.com will get two A-type answers : 192.168.0.10 and 192.168.0.11

I would like the 192.168.0.11 answer to be the only one, since this is an exception I would like to create in this case.

Works like a charm! Thank you very much for implementing this.

Did you get Lancache working with adguard? Can you post your syntax and where it goes?

@jdawgzim Lan cache is not supported out of the box if you don't want to use their DNS forwarder as an upstream. I use two scripts one fetches lists of domains from https://github.com/uklans/cache-domains.git and assigns my cache's IP. And second one that feeds AGH by calling it's API, adding new records and removing old ones.

In the edge build it is now possible to use $dnsrewrite modifier:
https://github.com/AdguardTeam/AdGuardHome/wiki/Hosts-Blocklists#dnsrewrite

@ameshkov great! That will make it way easier. Gotta try it out when it arrives into stable. Thank you for the heads up.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ammnt picture ammnt  路  4Comments

alexpovel picture alexpovel  路  3Comments

ammnt picture ammnt  路  3Comments

Iconology picture Iconology  路  3Comments

TXC picture TXC  路  3Comments