Answer the question
In order to leave comments, you need to log in
Why does the host utility make a UDP request to 127.0.0.1 on arbitrary ports?
Hello.
Debian 10
Opensnitch Firewall 1.4.0rc3
Domain names have been replaced or obscured.
In September 2021, I made a request through the host utility (/usr/bin/host) and after executing the command:
$ host -t txt _dmarc.domain.ru
Host _dmarc.domain.ru not found: 3(NXDOMAIN)
opensnitch firewall blocks UDP request from /usr/bin/host at 127.0.0.1:45671
I can't figure out what this extra request is?
If this is a normal situation, then where in the source code can you see the functionality of this connection? I searched did not find.
Thank you.
Additional information for September 2021:
$ cat /etc/debian_version
10.10
$ cat /etc/resolv.conf
nameserver 10.139.1.1
nameserver 10.139.1.2
$ sudo netstat -nlptu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 569/cupsd
tcp6 0 0 ::1:631 :::* LISTEN 569/cupsd
$ dpkg -S /usr/bin/host
bind9-host: /usr/bin/host
$ dpkg -L bind9-host
/.
/usr
/usr/bin
/usr/bin/host
/usr/share
/usr/share/doc
/usr/share/doc/bind9-host
/usr/share/doc/bind9-host/changelog.Debian.gz
/usr/share/doc/bind9-host/changelog.gz
/usr/share/doc/bind9-host/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/host.1.gz
$ apt show bind9-host
Package: bind9-host
Version: 1:9.11.5.P4+dfsg-5.1+deb10u5
Priority: standard
Section: net
Source: bind9
Maintainer: Debian DNS Team <[email protected]>
Installed-Size: 368 kB
Provides: host
Depends: libbind9-161 (= 1:9.11.5.P4+dfsg-5.1+deb10u5), libdns1104 (= 1:9.11.5.P4+dfsg-5.1+deb10u5), libisc1100 (= 1:9.11.5.P4+dfsg-5.1+deb10u5), libisccfg163 (= 1:9.11.5.P4+dfsg-5.1+deb10u5), liblwres161 (= 1:9.11.5.P4+dfsg-5.1+deb10u5), libc6 (>= 2.14), libcap2 (>= 1:2.10), libcom-err2 (>= 1.43.9), libfstrm0 (>= 0.2.0), libgeoip1, libgssapi-krb5-2 (>= 1.6.dfsg.2), libidn2-0 (>= 2.0.0), libjson-c3 (>= 0.10), libk5crypto3 (>= 1.6.dfsg.2), libkrb5-3 (>= 1.6.dfsg.2), liblmdb0 (>= 0.9.6), libprotobuf-c1 (>= 1.0.0), libssl1.1 (>= 1.1.0), libxml2 (>= 2.6.27)
Homepage: https://www.isc.org/downloads/bind/
Tag: implemented-in::c, interface::commandline, network::client,
network::service, protocol::dns, protocol::ssl, role::program
Download-Size: 271 kB
APT-Manual-Installed: yes
APT-Sources: https://deb.debian.org/debian buster/main amd64 Packages
Description: служба DNS (более не рекомендуется)
Этот пакет устанавливает /usr/bin/host, позволяющую устанавливать соответствия между
доменными именами и IP-адресами, из поставки BIND 9.X.
.
Эта утилита считается устаревшей, используйте dig или delv из пакета dnsutils.
$ host -t txt _dmarc.domain.ru
Хост _dmarc.domain.ru не найден: 3 (NXDOMAIN)
$ host garors.com
$ host ya.ru
ya.ru has address 87.250.250.242
ya.ru has IPv6 address 2a02:6b8::2:242
ya.ru mail is handled by 10 mx.yandex.ru.
$ cat /etc/resolv.conf
nameserver 10.139.1.1
nameserver 10.139.1.2
$ dpkg -S /usr/bin/host
bind9-host: /usr/bin/host
$ dpkg -l | grep bind9-host
ii bind9-host 1:9.11.5.P4+dfsg-5.1+deb10u5 amd64 DNS lookup utility (deprecated)
$ apt show bind9-host -a
Package: bind9-host
Version: 1:9.11.5.P4+dfsg-5.1+deb10u6
Priority: standard
Section: net
Source: bind9
Maintainer: Debian DNS Team <[email protected]>
Installed-Size: 368 kB
Provides: host
Depends: libbind9-161 (= 1:9.11.5.P4+dfsg-5.1+deb10u6), libdns1104 (= 1:9.11.5.P4+dfsg-5.1+deb10u6), libisc1100 (= 1:9.11.5.P4+dfsg-5.1+deb10u6), libisccfg163 (= 1:9.11.5.P4+dfsg-5.1+deb10u6), liblwres161 (= 1:9.11.5.P4+dfsg-5.1+deb10u6), libc6 (>= 2.14), libcap2 (>= 1:2.10), libcom-err2 (>= 1.43.9), libfstrm0 (>= 0.2.0), libgeoip1, libgssapi-krb5-2 (>= 1.6.dfsg.2), libidn2-0 (>= 2.0.0), libjson-c3 (>= 0.10), libk5crypto3 (>= 1.6.dfsg.2), libkrb5-3 (>= 1.6.dfsg.2), liblmdb0 (>= 0.9.6), libprotobuf-c1 (>= 1.0.0), libssl1.1 (>= 1.1.0), libxml2 (>= 2.6.27)
Homepage: https://www.isc.org/downloads/bind/
Download-Size: 271 kB
APT-Sources: https://deb.debian.org/debian-security buster/updates/main amd64 Packages
Description: служба DNS (более не рекомендуется)
Этот пакет устанавливает /usr/bin/host, позволяющую устанавливать соответствия между
доменными именами и IP-адресами, из поставки BIND 9.X.
.
Эта утилита считается устаревшей, используйте dig или delv из пакета dnsutils.
Package: bind9-host
Version: 1:9.11.5.P4+dfsg-5.1+deb10u5
Priority: standard
Section: net
Source: bind9
Maintainer: Debian DNS Team <[email protected]>
Installed-Size: 368 kB
Provides: host
Depends: libbind9-161 (= 1:9.11.5.P4+dfsg-5.1+deb10u5), libdns1104 (= 1:9.11.5.P4+dfsg-5.1+deb10u5), libisc1100 (= 1:9.11.5.P4+dfsg-5.1+deb10u5), libisccfg163 (= 1:9.11.5.P4+dfsg-5.1+deb10u5), liblwres161 (= 1:9.11.5.P4+dfsg-5.1+deb10u5), libc6 (>= 2.14), libcap2 (>= 1:2.10), libcom-err2 (>= 1.43.9), libfstrm0 (>= 0.2.0), libgeoip1, libgssapi-krb5-2 (>= 1.6.dfsg.2), libidn2-0 (>= 2.0.0), libjson-c3 (>= 0.10), libk5crypto3 (>= 1.6.dfsg.2), libkrb5-3 (>= 1.6.dfsg.2), liblmdb0 (>= 0.9.6), libprotobuf-c1 (>= 1.0.0), libssl1.1 (>= 1.1.0), libxml2 (>= 2.6.27)
Homepage: https://www.isc.org/downloads/bind/
Tag: implemented-in::c, interface::commandline, network::client,
network::service, protocol::dns, protocol::ssl, role::program
Download-Size: 271 kB
APT-Manual-Installed: yes
APT-Sources: https://deb.debian.org/debian buster/main amd64 Packages
Description: служба DNS (более не рекомендуется)
Этот пакет устанавливает /usr/bin/host, позволяющую устанавливать соответствия между
доменными именами и IP-адресами, из поставки BIND 9.X.
.
Эта утилита считается устаревшей, используйте dig или delv из пакета dnsutils.
[email protected]:~$ md5sum /usr/bin/host
9baaed6fcefa9c5528534d5996b2a886 /usr/bin/host
$ sudo netstat -nlptu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 632/cupsd
tcp6 0 0 ::1:631 :::* LISTEN 632/cupsd
Answer the question
In order to leave comments, you need to log in
Judging by the output of strace, host itself binds an arbitrary port to 127.0.0.1 for some reason and it is very likely that it sends packets to itself. That's why there is no point in fighting incoming connections from the loopback interface, especially if they go to non-administered services. Programs sometimes do this.
Why is host doing this? Yes, no one will say, because this code is deprecated.
1. Take strace and see if the utility actually makes system calls that result in such packets being sent.
2. Compare the bitwise binary with what is in the distribution.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question