This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_host_resolution_bad_address does not always fail as expected
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: barry, gregory.p.smith
Priority: normal Keywords:

Created on 2020-10-19 21:22 by barry, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 29085 merged barry, 2021-10-20 06:53
Messages (3)
msg379020 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2020-10-19 21:22
This is very likely caused by something janky my ISP (AT&T) is doing with IPv6, but the above named test fails for me because IPv6 addresses like `::1q` do not fail to resolve as the test expects.

I'm not sure what can or should be done about it, but as this is an annoying local failure, and I couldn't find another mention of it by searching bpo, I wanted to at least get it on record.

The test function's comment says:

"
        # These are all malformed IP addresses and expected not to resolve to
        # any result.  But some ISPs, e.g. AWS, may successfully resolve these
        # IPs.
"

So apparently, put AT&T in that bucket of ISPs that resolve those IPv6 addresses.
msg404396 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2021-10-20 06:49
Woot!  I finally figured out the problem and how to fix it.  It has nothing to do with Python and everything to do with AT&T.  They run a service called DNS Error Assist, quoting:

"Sometimes we enter a wrong search word, or a wrong web address, or maybe the website we want is no longer in service. If this happens, the DNS Error Assist service automatically searches for similar or related terms and presents you some results that may be useful for you. Otherwise, you’ll get a “No results found” error message."

Turning this off is buried in AT&T's site.  I found some outdated recommendations on the web, but here's what worked for me (as of the date of this comment).

Log in to your AT&T portal, search for "Privacy" and click on the link that says "Privacy in Support".  This takes you to a page that describes AT&T's privacy policies, and gives you a link to "Go" to your privacy settings.

From there you should see two sections, one that says "Control how we communicate with you" and one that says "Control how we use your data".  Select DNS Error Assist and disable that.  You'll need to wait a few minutes for it to take effect, but then you'll get none of those bogus resolutions.

While you're at it, you might want to review your other privacy settings.
msg404489 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2021-10-20 16:24
Rule #1 for home users:  Never use your ISPs DNS.  Always configure a reputable one in your router.  If you can't control your router, configure your computer to ignore the router's DNS.

Classic best in breed non-ISP servers exist: 8.8.8.8 (google), 9.9.9.9 (quad9), 1.1.1.1 (cloudflare?), etc.

ISPs often monetize DNS in nefarious ways.  If they control the router they can even decide to have it subvert those settings as DNS is unencrypted UDP so it can be redirected/intercepted/modified.  Avoiding that requires using DoH or DoT (DNS over HTTPS/TLS) but configuring that is way beyond what I'm capable of quipping in a box this small. :)
History
Date User Action Args
2022-04-11 14:59:37adminsetgithub: 86258
2021-10-20 16:24:00gregory.p.smithsetnosy: + gregory.p.smith
messages: + msg404489
2021-10-20 06:53:42barrysetpull_requests: + pull_request27351
2021-10-20 06:49:39barrysetstatus: open -> closed
versions: - Python 3.7, Python 3.8, Python 3.9, Python 3.10
messages: + msg404396

resolution: not a bug
stage: resolved
2020-10-19 21:22:22barrycreate