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
Implement DNS server #41
Conversation
@jackyzha0 :D Just a few comments to take into account for the implementation:
|
@fauno I think the port defaults to 53 right now, the getPort is just for testing. I think Firewall proxy makes the most sense to me? In your second bullet point, do you mean that the DNS server runs on the same host as the DP API and not the Sutty side right? |
If it defaults to 53 you'll have to run node as root or you'll get a port binding error
Yeah what I meant is that the CMS expects the DNS on the same host as the API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
One other change that should be made, the link
for IPFS/Hyper should use the DNS domain instead of the public key so that DP users will be linked to the "nice" URL
v1/dns/index.ts
Outdated
type: dns2.Packet.TYPE.TXT, | ||
class: dns2.Packet.CLASS.IN, | ||
ttl: 60, | ||
data: `dnslink=${links.ipfs.link}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link should be converted from ipns://KEY
to /ipns/KEY
Note that instead of using the link
we should be using the pubKey
URL
Similarly we should use dnslink=/hyper/'
for hyper, and using it's public key.
Make sure the hyper
one comes after IPFS dnslink
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you may have pressed enter too early for your comment on Hyper haha! Can you clarify what the link structure for hyper looks like? Is it sufficient to just do dnslink=/hyper/${links.hyper.link}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify what you meant by
One other change that should be made, the link for IPFS/Hyper should use the DNS domain instead of the public key so that DP users will be linked to the "nice" URL
I thought that link
would have been the nice URL but perhaps I don't understand how the URLs map in IPFS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an you clarify what the link structure for hyper looks like? Is it sufficient to just do dnslink=/hyper/${links.hyper.link}
Whoops, forgot to finish my sentance there. It should be dnslink=/hyper/${links.hyper.raw.slice('hyper://').length)}
Note how we want the raw public key and not the DNS domain which should be placed in the link
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that link would have been the nice URL but perhaps I don't understand how the URLs map in IPFS
At the moment DP produces links that look like ipns://IPNS_KEY_HERE
like ipns://bafywhateverelsehere
. This is the "raw" link for the public key and is not human readable.
The "nice" URL is one that contains the domain name (which is what this DNS server resolves) like ipns://distributed.press
.
The DNS server needs to serve TXT entries which link to the raw public keys of the sites since that's how clients turn the DNS domain name into the p2p URL that they can then resolve to the actual data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny changes, but feel free to merge after checking them
Co-authored-by: RangerMauve <RangerMauve@hotmail.com>
Co-authored-by: RangerMauve <RangerMauve@hotmail.com>
Closes #26