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 · 7 comments
Open

x/net/dns: add LookupCNAME #29039

therealjoesmith opened this issue Nov 30, 2018 · 7 comments

Comments

@therealjoesmith
Copy link

@therealjoesmith 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
@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
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Nov 30, 2018

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

Loading

@andybons
Copy link
Member

@andybons andybons commented Dec 5, 2018

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

Loading

@therealjoesmith
Copy link
Author

@therealjoesmith 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.

Loading

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Dec 5, 2018

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

Loading

@rsc
Copy link
Contributor

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

Loading

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

@odeke-em odeke-em commented Apr 9, 2020

Some more DNS goodies for you @iangudger, if interested.

Loading

@iangudger
Copy link
Contributor

@iangudger iangudger commented Apr 9, 2020

To clarify, the proposal that was accepted was adding LookupCNAME to x/net/dns? In order to do that, we are going to need a DNS client there.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants