9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] sshnet and the go dns resolver
@ 2021-02-23 21:34 Steve Simon
  2021-02-23 22:23 ` Fazlul Shahriar
  2021-02-23 23:23 ` Jeff Sickel
  0 siblings, 2 replies; 4+ messages in thread
From: Steve Simon @ 2021-02-23 21:34 UTC (permalink / raw)
  To: 9fans

hi,

the senerio - i have a plan9 terminal, a mac laptop. the laptop connects to a vpn.

i write in go, and thus far i use sshfs to mount the mac’s filesystem and edit my code. i build and run the code on the mac.

i thought i could use git9 via sshnet to work natively on plan9

most of this is fine but when go tries to access mod files for packages on the vpn i get a “no sutiable address found” error for proxy.golang.org.

i can resce the address i need (over the vpn) using ndb/dnsquery however.

if i try and build without my sshnet vpn connection then i get a different error which refers to a repository on the vpn.

so. i think the native resolver in the go libraries (and thus in the go executable) do not play nicely with sshnet.

my guess (only a guess) is go is trying to do its own name resolution using udp port 53 and sshnet does not support udp.

anyone any ideas?
can i convince go to use plan9’s own name resolution?
can ssh (and thus sshnet) forward udp or is that not possible?

thanks for any ideas

-Steve



------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T774469ff9f943e45-Me6b7b01e94fd355714ebf049
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] sshnet and the go dns resolver
  2021-02-23 21:34 [9fans] sshnet and the go dns resolver Steve Simon
@ 2021-02-23 22:23 ` Fazlul Shahriar
  2021-02-23 23:23 ` Jeff Sickel
  1 sibling, 0 replies; 4+ messages in thread
From: Fazlul Shahriar @ 2021-02-23 22:23 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 1558 bytes --]

The Go net package uses /net/cs and /net/dns. I see sshnet doesn't create
/net/dns. That could be the issue.

fhs

On Tue, Feb 23, 2021 at 4:35 PM Steve Simon <steve@quintile.net> wrote:

> hi,
> 
> the senerio - i have a plan9 terminal, a mac laptop. the laptop connects
> to a vpn.
> 
> i write in go, and thus far i use sshfs to mount the mac’s filesystem and
> edit my code. i build and run the code on the mac.
> 
> i thought i could use git9 via sshnet to work natively on plan9
> 
> most of this is fine but when go tries to access mod files for packages on
> the vpn i get a “no sutiable address found” error for proxy.golang.org.
> 
> i can resce the address i need (over the vpn) using ndb/dnsquery however.
> 
> if i try and build without my sshnet vpn connection then i get a different
> error which refers to a repository on the vpn.
> 
> so. i think the native resolver in the go libraries (and thus in the go
> executable) do not play nicely with sshnet.
> 
> my guess (only a guess) is go is trying to do its own name resolution
> using udp port 53 and sshnet does not support udp.
> 
> anyone any ideas?
> can i convince go to use plan9’s own name resolution?
> can ssh (and thus sshnet) forward udp or is that not possible?
> 
> thanks for any ideas
> 
> -Steve
> 

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T774469ff9f943e45-M6e96a817ce5e09891b086877
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 2930 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] sshnet and the go dns resolver
  2021-02-23 21:34 [9fans] sshnet and the go dns resolver Steve Simon
  2021-02-23 22:23 ` Fazlul Shahriar
@ 2021-02-23 23:23 ` Jeff Sickel
  2021-02-24  1:05   ` Steve Simon
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff Sickel @ 2021-02-23 23:23 UTC (permalink / raw)
  To: 9fans

I’ve noticed similar problems with go programs and resolving a lookup.
There are go programs that explicitly look for “/etc/resolv.conf” to
grab the nameserver to use, though it would be nice if the developer
were using the default net package for lookups.


> On Feb 23, 2021, at 3:34 PM, Steve Simon <steve@quintile.net> wrote:
> 
> hi,
> 
> the senerio - i have a plan9 terminal, a mac laptop. the laptop connects to a vpn.
> 
> i write in go, and thus far i use sshfs to mount the mac’s filesystem and edit my code. i build and run the code on the mac.
> 
> i thought i could use git9 via sshnet to work natively on plan9
> 
> most of this is fine but when go tries to access mod files for packages on the vpn i get a “no sutiable address found” error for proxy.golang.org.
> 
> i can resce the address i need (over the vpn) using ndb/dnsquery however.
> 
> if i try and build without my sshnet vpn connection then i get a different error which refers to a repository on the vpn.
> 
> so. i think the native resolver in the go libraries (and thus in the go executable) do not play nicely with sshnet.
> 
> my guess (only a guess) is go is trying to do its own name resolution using udp port 53 and sshnet does not support udp.
> 
> anyone any ideas?
> can i convince go to use plan9’s own name resolution?
> can ssh (and thus sshnet) forward udp or is that not possible?
> 
> thanks for any ideas
> 
> -Steve
> 

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T774469ff9f943e45-Mab4a9e43134cbeda9523e532
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] sshnet and the go dns resolver
  2021-02-23 23:23 ` Jeff Sickel
@ 2021-02-24  1:05   ` Steve Simon
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Simon @ 2021-02-24  1:05 UTC (permalink / raw)
  To: 9fans

thanks all for the suggestions.

digging through the source of sshnet.c and the go net library i think i understand.

the plan9 runtime library assumes, and insists the string returned from /net/cs contains a valid ip address.

the code in sshnet which serves a  /net/cs does a local ndb lookup, and if that fails, returns the dns name it was given. i guess this is to allow name resolution to be tried at the remote host.

i shall experiment a bit more.

-Steve



------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T774469ff9f943e45-M892fd19deed0c0a02dd942a8
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-24  1:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 21:34 [9fans] sshnet and the go dns resolver Steve Simon
2021-02-23 22:23 ` Fazlul Shahriar
2021-02-23 23:23 ` Jeff Sickel
2021-02-24  1:05   ` Steve Simon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).