diff --git a/examples/gnrc_border_router/Makefile b/examples/gnrc_border_router/Makefile index a0e8d59f6d..d9e3929e32 100644 --- a/examples/gnrc_border_router/Makefile +++ b/examples/gnrc_border_router/Makefile @@ -67,6 +67,11 @@ else ifeq (static,$(PREFIX_CONF)) # Only set this if the default router does not send router advertisements # IPV6_DEFAULT_ROUTER ?= fe80::1 USEMODULE += gnrc_ipv6_static_addr + + # configure static DNS server + ifneq (,$(filter sock_dns,$(USEMODULE))) + USEMODULE += auto_init_sock_dns + endif endif # Comment this out to disable code in RIOT that does safety checking diff --git a/sys/net/gnrc/network_layer/ipv6/nib/_nib-router.c b/sys/net/gnrc/network_layer/ipv6/nib/_nib-router.c index c7b15e5beb..4a61df12bd 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/_nib-router.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/_nib-router.c @@ -155,7 +155,8 @@ static gnrc_pktsnip_t *_build_ext_opts(gnrc_netif_t *netif, uint32_t rdnss_ltime = _evtimer_lookup(&sock_dns_server, GNRC_IPV6_NIB_RDNSS_TIMEOUT); - if ((rdnss_ltime < UINT32_MAX) && + /* with auto_init_sock_dns we always have a valid (static) DNS server */ + if (((rdnss_ltime < UINT32_MAX) || IS_USED(MODULE_AUTO_INIT_SOCK_DNS)) && (!ipv6_addr_is_link_local((ipv6_addr_t *)sock_dns_server.addr.ipv6))) { gnrc_pktsnip_t *rdnsso = gnrc_ndp_opt_rdnss_build( rdnss_ltime * MS_PER_SEC,