Skip to content

net/http: dns-should-not-resolve.golang DNS record found in the 4.2.2.2 DNS server. #16716

@jasonmoo

Description

@jasonmoo

Building go 1.7 with all.bash on osx/amd64, I noticed the following fail in the net/http package:

--- FAIL: TestTransportEventTraceRealDNS (0.06s)
    transport_test.go:3386: expected error during DNS lookup
FAIL

I dumped the httptrace used in the request that failed and found:

2016/08/15 22:23:02 DNSStart: {Host:dns-should-not-resolve.golang}
2016/08/15 22:23:02 DNSDone: {Addrs:[{IP:198.105.244.11 Zone:} {IP:198.105.254.11 Zone:}] Err:<nil> Coalesced:false}
2016/08/15 22:23:02 ConnectStart: tcp 198.105.244.11:80
2016/08/15 22:23:02 ConnectDone: tcp 198.105.244.11:80 <nil>

Seeing that the DNS was resolving I tested further with nslookup and discovered the DNS server I had been using (4.2.2.2) contained an entry.

jason@mba ~ : nslookup dns-should-not-resolve.golang
Server:     4.2.2.2
Address:    4.2.2.2#53

Non-authoritative answer:
Name:   dns-should-not-resolve.golang
Address: 198.105.244.11
Name:   dns-should-not-resolve.golang
Address: 198.105.254.11

Changing the DNS server to a different provider (8.8.8.8) showed no entry.

jason@mba ~ : nslookup dns-should-not-resolve.golang
Server:     8.8.8.8
Address:    8.8.8.8#53

** server can't find dns-should-not-resolve.golang: NXDOMAIN

This error has prevented my all.bash tests from passing. I'm not sure if there's a responsibility here to write tests that cannot be spoofed. What is the course to take?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions