Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tell dnsmasq not to pass requests upstream #223

Merged

Conversation

Travis-Snoozy
Copy link
Contributor

The behavior of dnsmasq changed in version 2.86 -- before then, if a record was set for a domain name with dnsmasq, and a record for a type not specified for that domain was requested, dnsmasq would indicate no data existed for that record type. After 2.86, record types that are not specified are instead passed upstream. The latter behavior causes problems for the Steam client, which will disregard a correctly set A-record for lancache.steamcontent.com, if no AAAA is set with dnsmasq and dnsmasq passes the AAAA query upstream. The documentation for dnsmasq indicates the correct way to restore the old behavior is to use the local=/host/ syntax -- emit this syntax for each of our lancache-hosted DNS entries.

What CDN does this PR relate to

Steam

Does this require running via sniproxy

N/A (create-dnsmasq.sh update)

Capture method

N/A (create-dnsmasq.sh update)

Testing Scenario

Home network, Linux, Windows, Steamdeck clients; OpenWRT (dnsmasq-based) router serving DNS. Deleted prior dnsmasq config, ran create-dnsmasq.sh, copied the generated output/dnsmasq/steam.conf file to the router's configuration directory for dnsmasq (/tmp/dnsmasq.d/), restarted dnsmasq on the router, and verified no AAAA record is served. Restarted Steam on each of the platforms, monitored the lancache access log, verified all three types of client access the cache correctly.

Testing Configuration

local=/lancache.steamcontent.com/
address=/lancache.steamcontent.com/192.168.42.10

Sniproxy output

N/A

The behavior of dnsmasq changed in version 2.86 -- before then, if a record was set for a domain name with dnsmasq, and a record for a type not specified for that domain was requested, dnsmasq would indicate no data existed for that record type. After 2.86, record types that are not specified are instead passed upstream. The latter behavior causes problems for, e.g., the Steam client, which will disregard a correctly set A-record for lancache.steamcontent.com, if no AAAA is set with dnsmasq and dnsmasq passes the AAAA query upstream. The documentation for dnsmasq indicates the correct way to restore the old behavior is to use the local=/host/ syntax -- emit this syntax for each of our lancache-hosted DNS entries.
@Travis-Snoozy
Copy link
Contributor Author

Note that an alternate approach -- setting the AAAA record to a nominal "NULL address" (the words of the dsmasq man page) via address=/lancache.steamcontent.com/:: -- was tested. While it does work for the Windows Steam client, it does not work for the Linux steam client.

Copy link
Contributor

@nightah nightah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, since I've stopped using dnsmasq I didn't pick this up personally but I did experience the issue just before I swapped.

For reference here's the explanation from the man page:

Note that the behaviour for queries which don't match the specified address literal changed in version 2.86. Previous versions, configured with (eg) --address=/example.com/1.2.3.4 and then queried for a RR type other than A would return a NoData answer. From 2.86, the query is sent upstream. To restore the pre-2.86 behaviour, use the configuration --address=/example.com/1.2.3.4 --local=/example.com/

Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
Copy link
Contributor

@nightah nightah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Lepidopterist Lepidopterist merged commit 31b2ba1 into uklans:master Mar 28, 2023
zeddius1983 added a commit to zeddius1983/cache-domains that referenced this pull request Sep 16, 2023
Tell dnsmasq not to pass requests upstream (uklans#223)
mezzovide added a commit to mezzovide/cache-domains that referenced this pull request Oct 17, 2023
Tell dnsmasq not to pass requests upstream (uklans#223)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants