Asterisk on 21.02 does strange address lookup

After installing 21.02-rc3 and asterisk to my router, I found this strange logs using logread after each incoming call:

Sun Aug  1 17:46:16 2021 daemon.info asterisk[5548]: [Aug  1 17:46:16] ERROR[5598]: netsock2.c:303 ast_sockaddr_resolve: getaddrinfo("Router", "(null)", ...): Name does not resolve
Sun Aug  1 17:46:16 2021 daemon.info asterisk[5548]: [Aug  1 17:46:16] WARNING[5598]: acl.c:890 resolve_first: Unable to lookup 'Router'
Sun Aug  1 17:46:16 2021 daemon.info asterisk[5548]: [Aug  1 17:46:16] ERROR[5598]: netsock2.c:303 ast_sockaddr_resolve: getaddrinfo("Router", "(null)", ...): Name does not resolve
Sun Aug  1 17:46:16 2021 daemon.info asterisk[5548]: [Aug  1 17:46:16] WARNING[5598]: acl.c:890 resolve_first: Unable to lookup 'Router'
Sun Aug  1 17:46:16 2021 daemon.info asterisk[5548]: [Aug  1 17:46:16] ERROR[6686]: netsock2.c:303 ast_sockaddr_resolve: getaddrinfo("Router", "(null)", ...): Name does not resolve
Sun Aug  1 17:46:16 2021 daemon.info asterisk[5548]: [Aug  1 17:46:16] WARNING[6686]: acl.c:890 resolve_first: Unable to lookup 'Router'
Sun Aug  1 17:46:16 2021 daemon.info asterisk[5548]: [Aug  1 17:46:16] ERROR[6688]: netsock2.c:303 ast_sockaddr_resolve: getaddrinfo("Router", "(null)", ...): Name does not resolve
Sun Aug  1 17:46:16 2021 daemon.info asterisk[5548]: [Aug  1 17:46:16] WARNING[6688]: acl.c:890 resolve_first: Unable to lookup 'Router'
Sun Aug  1 17:46:16 2021 daemon.info asterisk[5548]: [Aug  1 17:46:16] ERROR[6689]: netsock2.c:303 ast_sockaddr_resolve: getaddrinfo("Router", "(null)", ...): Name does not resolve
Sun Aug  1 17:46:16 2021 daemon.info asterisk[5548]: [Aug  1 17:46:16] WARNING[6689]: acl.c:890 resolve_first: Unable to lookup 'Router'

'Router' is the hostname of my router. That string is nowhere in the /etc/asterisk/ directory. Why is asterisk trying to resolve that name? As far as I know this problem was not in 19.07. The phone works fine, BTW

1 Like
ubus call system board; uci show dhcp; \
head -v -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*; \
nslookup router; nslookup router localhost
root@Router:/# ubus call system board
{
        "kernel": "5.4.124",
        "hostname": "Router",
        "system": "xRX200 rev 1.1",
        "model": "ZyXEL P-2812HNU-F1",
        "board_name": "zyxel,p-2812hnu-f1",
        "release": {
                "distribution": "OpenWrt",
                "version": "21.02.0-rc3",
                "revision": "r16172-2aba3e9784",
                "target": "lantiq/xrx200",
                "description": "OpenWrt 21.02.0-rc3 r16172-2aba3e9784"
        }
}
root@Router:/# uci show dhcp
dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded='1'
dhcp.@dnsmasq[0].localise_queries='1'
dhcp.@dnsmasq[0].rebind_protection='1'
dhcp.@dnsmasq[0].rebind_localhost='1'
dhcp.@dnsmasq[0].local='/lan/'
dhcp.@dnsmasq[0].domain='lan'
dhcp.@dnsmasq[0].expandhosts='1'
dhcp.@dnsmasq[0].authoritative='1'
dhcp.@dnsmasq[0].readethers='1'
dhcp.@dnsmasq[0].leasefile='/tmp/dhcp.leases'
dhcp.@dnsmasq[0].resolvfile='/tmp/resolv.conf.auto'
dhcp.@dnsmasq[0].filterwin2k='1'
dhcp.@dnsmasq[0].enable_tftp='1'
dhcp.@dnsmasq[0].tftp_root='/tmp/tftpd'
dhcp.@dnsmasq[0].localservice='0'
dhcp.wan=dhcp
dhcp.wan.interface='wan'
dhcp.wan.ignore='1'
dhcp.@host[0]=host
dhcp.@host[0].name='HL-4150CDN'
dhcp.@host[0].mac='00:1b:a9:61:a2:eb'
dhcp.@host[0].ip='172.16.20.190'
dhcp.@domain[0]=domain
dhcp.@domain[0].name='HL-4150CDN.lan'
dhcp.@domain[0].ip='172.16.20.190'
dhcp.WLAN2=dhcp
dhcp.WLAN2.start='100'
dhcp.WLAN2.leasetime='12h'
dhcp.WLAN2.limit='150'
dhcp.WLAN2.interface='WLAN2'
dhcp.WLAN2.dhcpv6='server'
dhcp.WLAN2.ra_management='1'
dhcp.WLAN2.ra='server'
dhcp.Wlan1=dhcp
dhcp.Wlan1.start='100'
dhcp.Wlan1.leasetime='12h'
dhcp.Wlan1.limit='150'
dhcp.Wlan1.interface='Wlan1'
dhcp.Wlan1.dhcpv6='server'
dhcp.Wlan1.ra_management='1'
dhcp.Wlan1.ra='server'
dhcp.Guest=dhcp
dhcp.Guest.start='100'
dhcp.Guest.leasetime='12h'
dhcp.Guest.limit='150'
dhcp.Guest.interface='Guest'
dhcp.lan=dhcp
dhcp.lan.leasetime='12h'
dhcp.lan.limit='150'
dhcp.lan.interface='lan'
dhcp.lan.dhcpv6='server'
dhcp.lan.ra_management='1'
dhcp.lan.ra='server'
dhcp.lan.start='20'
dhcp.ATA=dhcp
dhcp.ATA.start='100'
dhcp.ATA.leasetime='12h'
dhcp.ATA.limit='150'
dhcp.ATA.interface='ATA'
dhcp.USB=dhcp
dhcp.USB.start='100'
dhcp.USB.leasetime='12h'
dhcp.USB.limit='150'
dhcp.USB.interface='USB'
dhcp.USB.ra='server'
root@Router:/# head -v -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*
==> /etc/resolv.conf <==
# Interface wan
nameserver 213.75.63.78
nameserver 213.75.63.79

==> /tmp/resolv.conf <==
# Interface wan
nameserver 213.75.63.78
nameserver 213.75.63.79

==> /tmp/resolv.conf.auto <==

==> /tmp/resolv.conf.d <==
head: /tmp/resolv.conf.d: I/O error

==> /tmp/resolv.conf.d/resolv.conf.auto <==
# Interface wan
nameserver 213.75.63.78
nameserver 213.75.63.79
root@Router:/# nslookup router
Server:         213.75.63.78
Address:        213.75.63.78#53

** server can't find router: NXDOMAIN
** server can't find router: NXDOMAIN
root@Router:/# nslookup router localhost
Server:         localhost
Address:        127.0.0.1#53

Name:      router
Address 1: 172.16.20.254
Address 2: 172.16.24.254
Address 3: 172.16.23.254
Address 4: 192.168.1.1
Address 5: 172.16.20.254
Address 6: 172.16.27.254
Address 7: 172.16.28.254
*** Can't find router: No answer
1 Like
uci set dhcp.@dnsmasq[0].resolvfile="/tmp/resolv.conf.d/resolv.conf.auto"
uci commit dhcp
/etc/init.d/dnsmasq restart

OK, that solved the issue. Thanks. Yet it doesn't tell why asterisk tries to resolve that hostname.

1 Like

I'm not sure about the internals of Asterisk, but it's common practice for mail and web servers.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.