ethereum / ethereum-org-website

Ethereum.org is a primary online resource for the Ethereum community.
https://ethereum.org/
MIT License
5.09k stars 4.83k forks source link

Enode can work with DNS - doc suggests otherwise #11563

Open alex067 opened 1 year ago

alex067 commented 1 year ago

Describe the bug

Hey everyone.

The documentation for network addresses under the section for ENODE mentions the following:

 The hostname can only be given as an IP address; DNS names are not allowed. 

I believe this is not totally correct.

I'm able to spin up a local geth client, where the bootnode is pointing to an enode with a DNS name. Running admin_peers confirms that the DNS name is simply translated to an IP address.

To reproduce

  1. Spin up a geth node which is assigned a public, static ip address, and create a DNS record.
  2. Spin up a local geth client and configure --bootnodes to include the enode using DNS instead of an ip address.
  3. Perform rpc query admin_peers and confirm the DNS name is translated to the target ip address.

Expected behavior

The documentation should change slightly, to perhaps recommend referencing an ip address but mention that a DNS name will also work.

A possible edit: From:

The hostname can only be given as an IP address; DNS names are not allowed. 

To:

The hostname can be given as an IP address or a DNS name, however an IP address is recommended.

Screenshots

No response

Desktop (please complete the following information)

No response

Smartphone (please complete the following information)

No response

Additional context

No response

Would you like to work on this issue?

github-actions[bot] commented 11 months ago

This issue is stale because it has been open 45 days with no activity.

wackerow commented 5 months ago

Hey @alex067, this still an issue you'd like to work on? Can we confirm that DNS is accepted here, and it's not just your particular setup?

wackerow commented 5 months ago

@alex067 Apologize for the delays so far, but going ahead and assigning you if you'd like to post a PR for this.

corwintines commented 4 months ago

Could you expand on this @alex067?

What I am seeing from geth docs and other sources such as https://consensys.io/diligence/blog/2020/09/libp2p-multiaddr-enode-enr/ is that you can use an enode URL scheme, but this is different that DNS.

alex067 commented 4 months ago

Hey @wackerow thanks for assigning it to me. Happy to help here!

@corwintines of course. The issue is towards the hostname portion of the enode address, where the docs mention: The hostname can only be given as an IP address; DNS names are not allowed.

However this is not entirely accurate, as DNS names for hostnames do work as well.

alex067 commented 4 months ago

A good solution is to mention that most clients such as geth and besu, do support DNS resolution for the hostname portion of the enode. I suppose this is entirely client specific and not an actual standard.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity.

wackerow commented 2 months ago

Bump, just circling through... @alex067 Is this still something you're interested in working on?

alex067 commented 2 months ago

Hey @wackerow yes definitely. I'll submit a change this week.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity.

corwintines commented 2 weeks ago

@alex067 just checking if you were still interested in opening this PR :)