Network Applications Throwing "Servname Not Supported for Ai_Socktype"

Why are some network application failing with this error message?

$ whois example.com
getaddrinfo(whois.verisign-grs.com): Servname not supported for ai_socktype
0

1 Answer

This can occur when, due to misconfiguration, an unprivileged user does not have read access to /etc/services. Check with:

ls -l /etc/services

It should look like -rw-r--r-- 1 root root ...

The file should be installed from the Priority: important package netbase and have exactly these permissions. If not, fix it with:

sudo chown root:root /etc/services
sudo chmod 644 /etc/services

Nothing about the files contents is confidential or expected to change often. The file lists IANA-registered or common protocol port number associations for TCP, UDP, DCCP, and SCTP.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest