From a6d82b1a44818d57f27e5e4ce7e7c51ebd504183 Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Fri, 4 Jun 2021 18:39:28 +0200 Subject: [PATCH] Allow listen adresses to be non-numeric (using domains) --- man/iodine.8 | 4 +++- src/iodined.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/man/iodine.8 b/man/iodine.8 index 552f539..b1e8815 100644 --- a/man/iodine.8 +++ b/man/iodine.8 @@ -271,10 +271,12 @@ automatically fragmented when needed. .B -l listen_ip4 Make the server listen only on 'listen_ip4' for incoming IPv4 requests. By default, incoming requests are accepted from all interfaces (0.0.0.0). +A domain name can be used as argument - use one with only one A record. .TP .B -L listen_ip6 Make the server listen only on 'listen_ip6' for incoming IPv6 requests. -By default, incoming requests are accepted from all interfaces (::) +By default, incoming requests are accepted from all interfaces (::). +A domain name can be used as argument - use one with only one AAAA record. .TP .B -p port Make the server listen on 'port' instead of 53 for traffic. diff --git a/src/iodined.c b/src/iodined.c index d8878bd..f27da86 100644 --- a/src/iodined.c +++ b/src/iodined.c @@ -2578,14 +2578,14 @@ main(int argc, char **argv) foreground = 1; } if (addrfamily == AF_UNSPEC || addrfamily == AF_INET) { - dns4addr_len = get_addr(listen_ip4, port, AF_INET, AI_PASSIVE | AI_NUMERICHOST, &dns4addr); + dns4addr_len = get_addr(listen_ip4, port, AF_INET, AI_PASSIVE, &dns4addr); if (dns4addr_len < 0) { warnx("Bad IPv4 address to listen on."); usage(); } } if (addrfamily == AF_UNSPEC || addrfamily == AF_INET6) { - dns6addr_len = get_addr(listen_ip6, port, AF_INET6, AI_PASSIVE | AI_NUMERICHOST, &dns6addr); + dns6addr_len = get_addr(listen_ip6, port, AF_INET6, AI_PASSIVE, &dns6addr); if (dns6addr_len < 0) { warnx("Bad IPv6 address to listen on."); usage();