Skip to content

Commit f0dd701

Browse files
m-schmoockcdecker
authored andcommitted
doc: document the usage of DNS hostnames
This adds documentation on lightningd-config about the usage of DNS hostnames for --addr, --bind-addr and --announce-addr Changelog-None
1 parent 6af78c3 commit f0dd701

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

doc/lightningd-config.5.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,8 @@ precisely control where to bind and what to announce with the
493493
*bind-addr* and *announce-addr* options. These will **disable** the
494494
*autolisten* logic, so you must specifiy exactly what you want!
495495

496-
* **addr**=*\[IPADDRESS\[:PORT\]\]|autotor:TORIPADDRESS\[:SERVICEPORT\]\[/torport=TORPORT\]|statictor:TORIPADDRESS\[:SERVICEPORT\]\[/torport=TORPORT\]\[/torblob=\[blob\]\]*
496+
* **addr**=*\[IPADDRESS\[:PORT\]\]|autotor:TORIPADDRESS\[:SERVICEPORT\]\[/torport=TORPORT\]|statictor:TORIPADDRESS\[:SERVICEPORT\]\[/torport=TORPORT\]\[/torblob=\[blob\]\]|DNS\[:PORT\]*
497497

498-
499498
Set an IP address (v4 or v6) or automatic Tor address to listen on and
500499
(maybe) announce as our node address.
501500

@@ -531,10 +530,12 @@ defined by you and possibly different from your local node port assignment.
531530

532531
This option can be used multiple times to add more addresses, and
533532
its use disables autolisten. If necessary, and 'always-use-proxy'
534-
is not specified, a DNS lookup may be done to resolve 'IPADDRESS'
535-
or 'TORIPADDRESS'.
533+
is not specified, a DNS lookup may be done to resolve 'DNS' or 'TORIPADDRESS'.
534+
535+
If a 'DNS' hostname was given that resolves to a local interface, the daemon
536+
will bind to that interface and also announce that as type 'DNS'.
536537

537-
* **bind-addr**=*\[IPADDRESS\[:PORT\]\]|SOCKETPATH*
538+
* **bind-addr**=*\[IPADDRESS\[:PORT\]\]|SOCKETPATH|DNS\[:PORT\]|DNS\[:PORT\]*
538539

539540
Set an IP address or UNIX domain socket to listen to, but do not
540541
announce. A UNIX domain socket is distinguished from an IP address by
@@ -549,7 +550,10 @@ not specified, 9735 is used.
549550
its use disables autolisten. If necessary, and 'always-use-proxy'
550551
is not specified, a DNS lookup may be done to resolve 'IPADDRESS'.
551552

552-
* **announce-addr**=*IPADDRESS\[:PORT\]|TORADDRESS.onion\[:PORT\]*
553+
If a 'DNS' hostname was given and 'always-use-proxy' is not specified,
554+
a lookup may be done to resolve it and bind to a local interface (if found).
555+
556+
* **announce-addr**=*IPADDRESS\[:PORT\]|TORADDRESS.onion\[:PORT\]|DNS\[:PORT\]*
553557

554558
Set an IP (v4 or v6) address or Tor address to announce; a Tor address
555559
is distinguished by ending in *.onion*. *PORT* defaults to 9735.
@@ -561,8 +565,9 @@ announced addresses are public (e.g. not localhost).
561565
This option can be used multiple times to add more addresses, and
562566
its use disables autolisten.
563567

564-
If necessary, and 'always-use-proxy' is not specified, a DNS
565-
lookup may be done to resolve 'IPADDRESS'.
568+
Since v22.11 'DNS' hostnames can be used for announcement.
569+
Please note that a lot of mainnet nodes do not yet use, read or propagate this
570+
information correctly.
566571

567572
* **offline**
568573

lightningd/options.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static char *opt_add_addr_withtype(const char *arg,
222222
assert(arg != NULL);
223223
dns_ok = !ld->always_use_proxy && ld->config.use_dns;
224224

225-
/* Will be overridden in next call iff has port */
225+
/* Will be overridden in next call, if it has a port */
226226
port = 0;
227227
if (!separate_address_and_port(tmpctx, arg, &address, &port))
228228
return tal_fmt(NULL, "Unable to parse address:port '%s'", arg);

0 commit comments

Comments
 (0)