uklans / cache-domains

Domain Names required for LAN Content Cache DNS spoofing
MIT License
536 stars 498 forks source link

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

Open Hornochs opened 5 months ago

Hornochs commented 5 months ago

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.

Hornochs commented 5 months ago

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

nightah commented 4 months ago

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.

Hornochs commented 4 months ago

And there is the Problem.

The script generates a config, which tells Adguard to use a different Upstream DNS server on the LANcache domains. It is not an DNS Rewrite. Which means that in the current state the LANCache DNS Container is still necessary.

Am 19.03.2024 um 01:53 schrieb Amir Zarrinkafsh - notifications at github.com @.***>:



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.

— Reply to this email directly, view it on GitHubhttps://github.com/uklans/cache-domains/issues/235#issuecomment-2005524818, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APH6BQBAHBOFEDPDVU4LRD3YY6EAFAVCNFSM6AAAAABCY36WBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBVGUZDIOBRHA. You are receiving this because you authored the thread.Message ID: @.***>

nightah commented 4 months ago

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.

NathanAdhitya commented 4 months ago

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.

nightah commented 4 months ago

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.

Hornochs commented 4 months ago

That’s what I‘m doing atm. My AdGuard has the dns rewrites which points to the LANCache without the DNS container. And a upstream DNS Server is set for the other queries. I‘ll have a look in our git repo in some days the give you a sample config.

Unterwegs gesendet .

martincaddick commented 2 months ago

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 --

shinji257 commented 1 month ago

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