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

x/net/dns: add LookupCNAME #29039

Open
therealjoesmith opened this Issue Nov 30, 2018 · 5 comments

Comments

Projects
None yet
5 participants
@therealjoesmith
Copy link

therealjoesmith commented Nov 30, 2018

What version of Go are you using (go version)?

$ go version
go version go1.11.1 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What did you do?

https://play.golang.org/p/HTHVSd81SPJ

What did you expect to see?

I wanted to see the chain of CNAME records for www.microsoft.com.

What did you see instead?

Go returns only the last record. That's correct (it is the canonical name after all), but there are situations where it's interesting to probe the chain. On the command line, try:

$ host www.microsoft.com
www.microsoft.com is an alias for www.microsoft.com-c-3.edgekey.net.
www.microsoft.com-c-3.edgekey.net is an alias for www.microsoft.com-c-3.edgekey.net.globalredir.akadns.net.
www.microsoft.com-c-3.edgekey.net.globalredir.akadns.net is an alias for e13678.dspb.akamaiedge.net.
e13678.dspb.akamaiedge.net has address 23.211.9.92
e13678.dspb.akamaiedge.net has IPv6 address 2a02:26f0:d3:484::356e
e13678.dspb.akamaiedge.net has IPv6 address 2a02:26f0:d3:48c::356e

I'd like functions that return a []string of the intermediaries instead of just the final CNAME.

@gopherbot gopherbot added this to the Proposal milestone Nov 30, 2018

@gopherbot gopherbot added the Proposal label Nov 30, 2018

@agnivade agnivade changed the title Proposal: New LookupCNAME() functions to list chained CNAME records proposal: net: new LookupCNAME() functions to list chained CNAME records Nov 30, 2018

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

ianlancetaylor commented Nov 30, 2018

This may be more appropriate for golang.org/x/net/dns, or similar, rather than the standard library.

@andybons

This comment has been minimized.

Copy link
Member

andybons commented Dec 5, 2018

@therealjoesmith how do you feel about @ianlancetaylor’s suggestion to have this in /x/net/dns?

@therealjoesmith

This comment has been minimized.

Copy link
Author

therealjoesmith commented Dec 5, 2018

I don't have any convincing argument either way. I appreciate the standard library is already complicated as it is. I'll leave it to more informed contributors to make that decision.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

ianlancetaylor commented Dec 5, 2018

Is there any reason that the new functionality could not go in x/net/dns?

@rsc

This comment has been minimized.

Copy link
Contributor

rsc commented Dec 12, 2018

If you want detailed DNS information, the right thing to do is to use a DNS-specific package. The routines in package net are for getting basic stuff done, not advanced queries. It's probably fine to add to x/net/dns but that doesn't need to be a proposal. /cc @miekg

@rsc rsc changed the title proposal: net: new LookupCNAME() functions to list chained CNAME records x/net/dns: add LookupCNAME Dec 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.