{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/8516","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/8516/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/8516/comments","events_url":"https://api.github.com/repos/golang/go/issues/8516/events","html_url":"https://github.com/golang/go/issues/8516","id":51288309,"number":8516,"title":"net: document and check LookupCNAME on non-CNAME hosts","user":{"login":"egonelbre","id":192964,"avatar_url":"https://avatars.githubusercontent.com/u/192964?v=3","gravatar_id":"","url":"https://api.github.com/users/egonelbre","html_url":"https://github.com/egonelbre","followers_url":"https://api.github.com/users/egonelbre/followers","following_url":"https://api.github.com/users/egonelbre/following{/other_user}","gists_url":"https://api.github.com/users/egonelbre/gists{/gist_id}","starred_url":"https://api.github.com/users/egonelbre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egonelbre/subscriptions","organizations_url":"https://api.github.com/users/egonelbre/orgs","repos_url":"https://api.github.com/users/egonelbre/repos","events_url":"https://api.github.com/users/egonelbre/events{/privacy}","received_events_url":"https://api.github.com/users/egonelbre/received_events","type":"User","site_admin":false},"labels":[{"id":373399998,"url":"https://api.github.com/repos/golang/go/labels/NeedsFix","name":"NeedsFix","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"quentinmit","id":115761,"avatar_url":"https://avatars.githubusercontent.com/u/115761?v=3","gravatar_id":"","url":"https://api.github.com/users/quentinmit","html_url":"https://github.com/quentinmit","followers_url":"https://api.github.com/users/quentinmit/followers","following_url":"https://api.github.com/users/quentinmit/following{/other_user}","gists_url":"https://api.github.com/users/quentinmit/gists{/gist_id}","starred_url":"https://api.github.com/users/quentinmit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quentinmit/subscriptions","organizations_url":"https://api.github.com/users/quentinmit/orgs","repos_url":"https://api.github.com/users/quentinmit/repos","events_url":"https://api.github.com/users/quentinmit/events{/privacy}","received_events_url":"https://api.github.com/users/quentinmit/received_events","type":"User","site_admin":false},"assignees":[{"login":"quentinmit","id":115761,"avatar_url":"https://avatars.githubusercontent.com/u/115761?v=3","gravatar_id":"","url":"https://api.github.com/users/quentinmit","html_url":"https://github.com/quentinmit","followers_url":"https://api.github.com/users/quentinmit/followers","following_url":"https://api.github.com/users/quentinmit/following{/other_user}","gists_url":"https://api.github.com/users/quentinmit/gists{/gist_id}","starred_url":"https://api.github.com/users/quentinmit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quentinmit/subscriptions","organizations_url":"https://api.github.com/users/quentinmit/orgs","repos_url":"https://api.github.com/users/quentinmit/repos","events_url":"https://api.github.com/users/quentinmit/events{/privacy}","received_events_url":"https://api.github.com/users/quentinmit/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/49","html_url":"https://github.com/golang/go/milestones/Go1.9","labels_url":"https://api.github.com/repos/golang/go/milestones/49/labels","id":2053058,"number":49,"title":"Go1.9","description":"","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":300,"closed_issues":19,"state":"open","created_at":"2016-10-06T18:17:55Z","updated_at":"2016-12-02T23:26:52Z","due_on":"2017-07-31T00:00:00Z","closed_at":null},"comments":8,"created_at":"2014-08-12T06:05:39Z","updated_at":"2016-12-03T00:23:32Z","closed_at":null,"body":"<pre>LookupCNAME does not have clear behavior what it does when the DNS query succeeds and\nthere isn't a CNAME record.\n\nComment says that:\n\n// LookupCNAME returns the canonical DNS host for the given name.\n// Callers that do not care about the canonical name can call\n// LookupHost or LookupIP directly; both take care of resolving\n// the canonical name as part of the lookup.\n\nSo, just to clarify does it need to do:\n\n1. return &quot;&quot;, nil\n2. return &quot;&quot;, errors.New(&quot;CNAME not found&quot;)\n3. return fqdn(name), nil\n\nGiven the comment, the approach 3. seems to be the correct one, because CNAME declares\nalias names, and the canonical name for X, if there are no CNAME records, is X itself.\nOf course some code could rely on returning &quot;&quot; and error.\n\nOf course the code doesn't seem to be doing that - In Windows it's doing 2. in Linux 3.\n\nAlso, when researching this I noticed in dnsclient_unix.go at line 432, \n\n&gt; func goLookupCNAME(name string) (cname string, err error) {\n&gt;    _, rr, err := lookup(name, dnsTypeCNAME)\n&gt;    if err != nil {\n&gt;        return\n&gt;    }\n&gt;    cname = rr[0].(*dnsRR_CNAME).Cname\n&gt;    return\n&gt; }\n\nIt looks like it might blow up when len(rr) == 0.</pre>\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/264597986","html_url":"https://github.com/golang/go/issues/8516#issuecomment-264597986","issue_url":"https://api.github.com/repos/golang/go/issues/8516","id":264597986,"user":{"login":"rhansen","id":1612291,"avatar_url":"https://avatars.githubusercontent.com/u/1612291?v=3","gravatar_id":"","url":"https://api.github.com/users/rhansen","html_url":"https://github.com/rhansen","followers_url":"https://api.github.com/users/rhansen/followers","following_url":"https://api.github.com/users/rhansen/following{/other_user}","gists_url":"https://api.github.com/users/rhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/rhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhansen/subscriptions","organizations_url":"https://api.github.com/users/rhansen/orgs","repos_url":"https://api.github.com/users/rhansen/repos","events_url":"https://api.github.com/users/rhansen/events{/privacy}","received_events_url":"https://api.github.com/users/rhansen/received_events","type":"User","site_admin":false},"created_at":"2016-12-03T00:23:32Z","updated_at":"2016-12-03T00:23:32Z","body":"For POSIX-ish systems (Linux, BSD, OS X), what about using the value returned by `getaddrinfo()` with the `AI_CANONNAME` flag set?"}}
{"actor":{"display_login":"rhansen"}}