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

node/dns: allow setting different public-host for root server #809

Open
rithvikvibhu opened this issue Mar 21, 2023 · 5 comments
Open

node/dns: allow setting different public-host for root server #809

rithvikvibhu opened this issue Mar 21, 2023 · 5 comments

Comments

@rithvikvibhu
Copy link
Member

Currently, RootResolver gets the public-host config and this IP address is used when queried for root NS:

❯ dig . NS +nocomments

; <<>> DiG 9.16.1-Ubuntu <<>> . NS +nocomments
;; global options: +cmd
;.                              IN      NS
.                       85213   IN      NS     _g6cr3n0._synth.
;; Query time: 4 msec
;; SERVER: 127.0.0.50#53(127.0.0.50)
;; WHEN: Tue Mar 21 14:26:07 UTC 2023
;; MSG SIZE  rcvd: 68

Here, _g6cr3n0._synth. translates to the public IP of the node. While this works in most cases, when:

  • the node is a publicly reachable node, and
  • is running a private root server (bound to loopback)

then dig +trace breaks.
When tracing, dig will try to query the root NS at the public IP which won't work since it is private.


I think we should have a new config option: ns-public-host which:

  • may (or not) be public
  • is passed to new RootResolver({publicHost: ...})
  • and is returned for dig . NS

Can confirm this change makes dig domain +trace work properly.

@pinheadmz
Copy link
Member

isn't there rs-host and ns-host already?

@pinheadmz
Copy link
Member

#630 ?

@rithvikvibhu
Copy link
Member Author

Yes, ns-host defines what interface/IP to bind to. But the synth record that the NS responds with is for public-host which can be different from ns-host.

hsd/lib/dns/server.js

Lines 139 to 143 in 6b47c3a

// Create SYNTH record to use for root zone NS
let ip = IP.toBuffer(this.publicHost);
if (IP.family(this.publicHost) === 4)
ip = ip.slice(12);
this.synth = `_${base32.encodeHex(ip)}._synth.`;

@pinheadmz
Copy link
Member

pinheadmz commented Mar 21, 2023

hm ok i thought this in that context referred to the DNS server, so this.publicHost === server.publicHost === rs-host ?

@rithvikvibhu
Copy link
Member Author

Currently,

  • config.publicHost == pool.publicHost == ns.publicHost
  • config.nsHost is only for NS binding
  • config.rsHost is only for RS binding

I think we need to replace the first one with:

  • config.publicHost == pool.publicHost
  • config.nsPublicHost == ns.publicHost (and maybe fallback to the old publicHost)

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

No branches or pull requests

2 participants