Skip to content

Commit 50fe752

Browse files
authored
Merge pull request #195 from tnull/2026-04-configurable-dns-resolver
2 parents 570ed52 + 77aa6be commit 50fe752

6 files changed

Lines changed: 261 additions & 5 deletions

File tree

Cargo.lock

Lines changed: 16 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/ldk-server-config.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,16 @@ poll_metrics_interval = 60 # The polling interval for metrics in seconds.
103103
[tor]
104104
# Only connections to OnionV3 peers will be made via this proxy; other connections (IPv4 peers, Electrum server) will not be routed over Tor.
105105
#proxy_address = "127.0.0.1:9050" # Tor daemon SOCKS proxy address.
106+
107+
# Human-Readable Names (BIP 353) resolution
108+
[hrn]
109+
# Resolution method: "dns" (resolve locally via a DNS server) or "blip32" (ask other
110+
# nodes to resolve for us via bLIP-32). Defaults to "dns".
111+
#mode = "dns"
112+
# DNS server used when `mode = "dns"`. Defaults to 8.8.8.8:53 (Google Public DNS). The
113+
# port defaults to 53 if omitted (e.g., "1.1.1.1" is treated as "1.1.1.1:53").
114+
#dns_server_address = "8.8.8.8:53"
115+
# When set to true (and `mode = "dns"`), also offer HRN resolution to the rest of the
116+
# network over Onion Messages. Requires the node to be announceable so resolution
117+
# requests can be routed to us. Defaults to false.
118+
#enable_resolution_service = false

docs/configuration.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,23 @@ are not proxied. This does not set up inbound connections, to make your node rea
123123
hidden service, you need to configure Tor separately. See the [Tor guide](tor.md) for the
124124
full setup.
125125

126+
### `[hrn]`
127+
128+
Configures how the node resolves [BIP 353](https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki)
129+
Human-Readable Names (e.g., `₿alice@example.com`) to Lightning payment destinations.
130+
131+
Two resolution methods are supported via the `mode` field:
132+
133+
- **`"dns"`** (default) - Resolve names locally using a DNS server. The server is set via
134+
`dns_server_address` (default: `8.8.8.8:53`, Google Public DNS). The port defaults to
135+
`53` if omitted. When `enable_resolution_service = true`, the node additionally offers
136+
HRN resolution to the rest of the network over Onion Messages. This requires the node
137+
to be announceable so resolution requests can be routed to it, and is therefore
138+
disabled by default.
139+
- **`"blip32"`** - Ask other nodes to resolve names on our behalf via
140+
[bLIP-32](https://github.com/lightning/blips/blob/master/blip-0032.md). `dns_server_address`
141+
and `enable_resolution_service` only apply in `"dns"` mode and are rejected here.
142+
126143
## Storage Layout
127144

128145
```

ldk-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
ldk-node = { git = "https://github.com/lightningdevkit/ldk-node", rev = "c754e2fe85c70741b5e370334cd16856c615265e" }
7+
ldk-node = { git = "https://github.com/lightningdevkit/ldk-node", rev = "21eea8c881790db7a90bcad4f7f45f341c72222b" }
88
serde = { version = "1.0.203", default-features = false, features = ["derive"] }
99
hyper = { version = "1", default-features = false, features = ["server", "http2"] }
1010
http-body-util = { version = "0.1", default-features = false }

ldk-server/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ fn main() {
141141
ldk_node_config.listening_addresses = config_file.listening_addrs;
142142
ldk_node_config.announcement_addresses = config_file.announcement_addrs;
143143
ldk_node_config.network = config_file.network;
144+
ldk_node_config.hrn_config = config_file.hrn_config;
144145

145146
let mut builder = Builder::from_config(ldk_node_config);
146147
builder.set_log_facade_logger();

0 commit comments

Comments
 (0)