ens

源代码 主页

通过以下代码启用
ens:github.com/wealdtech/coredns-ens

ens - 从以太坊名称服务中提供 DNS 记录。

说明

ens 插件从以太坊名称服务中提供 DNS 记录。以太坊为相关域提供 DNS 记录的权威来源,允许任何名称服务器提供权威数据,而无需对 DNS 记录本身拥有写入权限。

建议将其放在 plugins.cfg 文件的 rewrite 之后。

语法

ens {
  # connection is the connection to an Ethereum node.  It is *highly*
  # recommended that a local node is used, as remote connections can
  # cause DNS requests to time out.
  # This can be either a path to an IPC socket or a URL to a JSON-RPC
  # endpoint.
  connection CONNECTION

  # ethlinknameservers are the names of the nameservers that serve
  # EthLink domains.  This will usually be the name of this server,
  # plus potentially one or more others.
  ethlinknameservers SERVER...

  # ipfsgatewaya is the address of an ENS-enabled IPFS gateway.
  # This value is returned when a request for an A record of an Ethlink
  # domain is received and the domain has a contenthash record in ENS but
  # no A record.  Multiple values can be supplied, separated by a space,
  # in which case all records will be returned.
  ipfsgatewaya ADDRESS...

  # ipfsgatewayaaaa is the address of an ENS-enabled IPFS gateway.
  # This value is returned when a request for an AAAA record of an Ethlink
  # domain is received and the domain has a contenthash record in ENS but
  # no A record.  Multiple values can be supplied, separated by a space,
  # in which case all records will be returned.
  ipfsgatewayaaaa ADDRESS...
}

示例

ens {
  connection /home/ethereum/.ethereum/geth.ipc
  ethlinknameservers ns1.ethdns.xyz ns2.ethdns.xyz
  ipfsgatewaya 176.9.154.81
  ipfsgatewayaaaa 2a01:4f8:160:4069::2
}