When I run the following command: nc -luvp 9090
, I get the error: getnameinfo: Temporary failure in name resolution
I've scanned the internet in search of an answer, but none of them were valid:
I found this link: https://unix.stackexchange.com/questions/504963/how-to-solve-a-temporary-failure-in-name-resolution-error And tried the most upvoted answer. My results:
I'm using NordVPN, which uses its own DNS servers. But I tried disabling it completely, and I get the same exact result. I'm afraid it messed up with my DNS config file and/or firewall rules.
I'm kinda new to Linux and feel a bit lost.
The problem could be with the DNS resolver. Try updating the namespace in /etc/resolv.conf
as follows.
nameserver 8.8.8.8
You seem to be using systemd-resolved
for your DNS resolver, which seems unable to resolve 0.0.0.0
:
$ resolvectl query 0.0.0.0
0.0.0.0: resolve call failed: No appropriate name servers or networks for name found
$ host 0.0.0.0 127.0.0.53
Using domain server:
Name: 127.0.0.53
Address: 127.0.0.53#53
Aliases:
Host 0.0.0.0.in-addr.arpa not found: 2(SERVFAIL)
This is the address netcat
is trying to resolve and fails (in my tests at least). One solution is to add a static association by adding the following line in /etc/hosts
:
0.0.0.0 localhost
netcat
should not abort for such a harmless DNS failure (it works when using the -n
switch or removing the -v
switch) and systemd-resolved
should probably not send SERVFAIL
when resolving 0.0.0.0
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With