uklans/cache-domains

Generating AdGuard Config let it still be necessary to let a DNS server for LANCache running

Opened this issue · 9 comments

Describe the issue you are having

Script generator for AdGuard generates the wrong modus

Describe your setup?

AdGuard directly and later LANCache in docker.
—————
Hey Guys,

I noticed today that the script of generating the AdGuard Config makes it still necessary to let the DNS Server from LANCache be Running. But my goal is to let only one DNS server run. Which means the script shouldn’t generate specific upstream DNS, rather it should generate DNS rewrites that points directly to the LANCache. In that way there won’t be another instance of an DNS server needed.

I’ll try to build a bash script which generates the needed YAML output. It’s working what I did manually

Not sure I understand your description of the problem, the whole point of the script generation is so that your upstream DNS service such as AdGuard can be called directly and the LANCache DNS container isn't necessary anymore.

I don't personally use AdGuard and it was a community contribution by @NathanAdhitya.

It looks like the script just needs to be written to use the dnsrewrite syntax.

I was surprised by the sudden tag. Indeed the rules it generates is to redirect the DNS queries for domains specified in this repo to LANCache's DNS Server. I'm not sure why rewriting it directly didn't come across my mind back then 😁.

I think the change/addition would be a good idea, although a separate script might be a better idea as changing the current script directly might break existing implementations.

The intent of the scripts in this repository are to create DNS rules to point to your LANcache instance. Not to forward to another upstream DNS on a per domain basis.

The easier way to achieve this with AdGuard would be to set its singular upstream as LANCache DNS and then set that upstream to whatever you use to resolve external DNS.

Not a perfect solution but works for me. I just went to the Custom Filtering Rules and added the IPhostname like this

192.168.2.2 com.edgesuite.net
192.168.2.2 com.nsatc.net
192.168.2.2 download.windowsupdate.com
-- snip --

I edited the AdGuardHome.yaml file directly to bulk add Adguard Home rewrites for all the new DNS entries. This way at least the log records in an expected way. I manually handle it from there based on new git commits here.

Example:

  rewrites:
    - domain: assetcdn.101.arenanetworks.com
      answer: 10.0.0.209
    - domain: assetcdn.102.arenanetworks.com
      answer: 10.0.0.209
    - domain: assetcdn.103.arenanetworks.com
      answer: 10.0.0.209