https://codereview.appspot.com/6675043/diff/5001/src/pkg/net/dnsclient.go File src/pkg/net/dnsclient.go (right): https://codereview.appspot.com/6675043/diff/5001/src/pkg/net/dnsclient.go#newcode230 src/pkg/net/dnsclient.go:230: // An NS represents a single DNS NS record. ...
11 years, 6 months ago
(2012-10-13 08:03:06 UTC)
#3
On 2012/10/13 16:11:08, mikio wrote: > please add lookupNS func for plan9, windows too. I ...
11 years, 6 months ago
(2012-10-14 02:30:09 UTC)
#7
On 2012/10/13 16:11:08, mikio wrote:
> please add lookupNS func for plan9, windows too.
I did my best to implement the func for plan9 and windows, but don't have access
to either os to test things.
What do people usually do in my circumstance?
On Sun, Oct 14, 2012 at 01:46:15PM +1100, Dave Cheney wrote: >Lucio and Alex/Mikio can ...
11 years, 6 months ago
(2012-10-14 03:03:54 UTC)
#10
On Sun, Oct 14, 2012 at 01:46:15PM +1100, Dave Cheney wrote:
>Lucio and Alex/Mikio can help with plan9 / windows respectively.
If it helps, I have been using the following command to test things:
package main
import (
"fmt"
"net"
"os"
)
const usage = "main <hostname>\n"
func main() {
if len(os.Args) != 2 {
fmt.Fprintf(os.Stderr, usage)
os.Exit(1)
}
n, _ := net.LookupNS(os.Args[1])
for i, v := range n {
fmt.Printf("%v %v %v\n", i, v, v.Host)
}
}
And I compare with the output for dig against gmail.com, mcquay.me, yahoo.com.
Thanks,
--
Stephen M. McQuay
http://mcquay.me/vcf
You'd better simplify the description a bit, i suggest this: net: add LookupNS(domain string) Fixes ...
11 years, 6 months ago
(2012-10-14 16:47:15 UTC)
#11
You'd better simplify the description a bit, i suggest this:
net: add LookupNS(domain string)
Fixes issue 4224.
For windows, you need to do more, as syscall doesn't define
syscall.DNSNSData, you need to use syscall.DNSPTRData directly.
Take lookupCNAME as an example.
https://codereview.appspot.com/6675043/diff/6005/src/pkg/net/lookup.go File src/pkg/net/lookup.go (right): https://codereview.appspot.com/6675043/diff/6005/src/pkg/net/lookup.go#newcode50 src/pkg/net/lookup.go:50: // LookupNS returns the DNS NS records for the ...
11 years, 6 months ago
(2012-10-14 20:28:51 UTC)
#12
On 2012/10/14 16:47:15, minux wrote: > For windows, you need to do more, as syscall ...
11 years, 6 months ago
(2012-10-14 20:32:52 UTC)
#13
On 2012/10/14 16:47:15, minux wrote:
> For windows, you need to do more, as syscall doesn't define
> syscall.DNSNSData, you need to use syscall.DNSPTRData directly.
> Take lookupCNAME as an example.
I tried to bring parity with lookupCNAME. From my inspection of DNSPTRData and
DnsQuery it seems I may be closer.
On Mon, Oct 15, 2012 at 03:24:37AM +0000, alex.brainman@gmail.com wrote: >LGTM > >Nicely done. Thank ...
11 years, 6 months ago
(2012-10-15 04:04:33 UTC)
#15
On Mon, Oct 15, 2012 at 03:24:37AM +0000, alex.brainman@gmail.com wrote:
>LGTM
>
>Nicely done. Thank you.
Thanks!
>You are creating some new public names. Lets leave it for a few days to
>give Go team members chance to comment.
Sounds reasonable.
>You need to sign the agreement
>http://golang.org/doc/contribute.html#copyright before you change can
>be submitted.
I believe I've filled it out before, but just did for good measure. How
can I figure out if it's been recorded?
Thanks, Alex,
--
Stephen M. McQuay
http://mcquay.me/vcf
On 2012/10/15 04:04:33, smcquay wrote: > ... > I believe I've filled it out before, ...
11 years, 6 months ago
(2012-10-15 04:08:00 UTC)
#16
On 2012/10/15 04:04:33, smcquay wrote:
> ...
> I believe I've filled it out before, but just did for good measure. How
> can I figure out if it's been recorded?
>
I do not see these myself. Only golang team gophers do. But, do not worry, we
will find your record once we are ready to submit.
Alex
Sorry for being late to this game, but why is this useful? LookupMX returns an ...
11 years, 6 months ago
(2012-10-15 17:43:20 UTC)
#18
Sorry for being late to this game, but why is this useful?
LookupMX returns an address you can use with smtp.Dial.
LookupNS returns an address that can't be used by any standard API that I'm
aware of.
rsc -- On Mon, Oct 15, 2012 at 05:43:21PM +0000, rsc@golang.org wrote: >Sorry for being ...
11 years, 6 months ago
(2012-10-15 18:25:00 UTC)
#19
rsc --
On Mon, Oct 15, 2012 at 05:43:21PM +0000, rsc@golang.org wrote:
>Sorry for being late to this game, but why is this useful?
You'll have to forgive my enthusiasm; I saw an issue (4224) that
I thought I could knock out and hacked it up before I put much thought
into the 'why useful'.
>LookupMX returns an address you can use with smtp.Dial.
>LookupNS returns an address that can't be used by any standard API that
>I'm aware of.
I found in my tests that the Host field of the NS struct can be used in
calls to Lookup*, for what it's worth. Also, when I've needed NS info in
the past, I run dig and the string hostname is typically what I'm after.
I am guessing that the reporter had reason to post, and would be happy
to follow up in the issue's comments.
Respectfully,
--
Stephen M. McQuay
http://mcquay.me/vcf
On 2012/10/15 18:25:00, smcquay wrote: > I am guessing that the reporter had reason to ...
11 years, 6 months ago
(2012-10-15 23:38:36 UTC)
#20
On 2012/10/15 18:25:00, smcquay wrote:
> I am guessing that the reporter had reason to post, and would be happy
> to follow up in the issue's comments.
Hi,
I am the reporter of the issue 4224.
I issued this when starting to develop something that depends on checking the
DNS status headers of a domain (NOERROR, NXDOMAIN, etc) by querying it's NS.
Something able to get information like the "dig" command does.
I've ended up using a 3rd party lib for now, but I think some of the DNS
internal functions in Go's net pkg could solve my problem if they were exported.
IMHO I should note that I net.Lookup* functions is a strange mix of simple
basic/general resolv/DNS functions (LookupAddr, LookupHost, LookupIP) and more
DNS specific functions (LookupCNAME, ...MX, ...SRV, ...TXT), but this set of
specific functions is incomplete. Maybe Go should have a net/dns package with
these features in it, maybe not. Maybe Go could have some way to return DNS
headers of each query. I'm not sure what is the best approach.
Thank you all!
Issue 6675043: code review 6675043: net: Add function to expose NS records for a domain
(Closed)
Created 11 years, 6 months ago by smcquay
Modified 11 years, 6 months ago
Reviewers:
Base URL:
Comments: 10