Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How do I fix “getaddrinfo: localhost Name or service not found” for telnet server?

I've installed a new Ubuntu 12.04 on an AWS EC2 instance and everything worked fine till now. I followed the instructions in this great tutorial:

Now i'm on the point "installing monit" and when i restart the service i get this error message now:

monit: Cannot translate '(none)' to FQDN name -- Name or service not known

I started googling and someone is writing there, that monit uses getaddrinfo in his startup-process to determine the hostname. Ok, so i thought i try out on myself what is getaddrinfo delivering, and then i got:

getaddrinfo: command not found

I guess, something is missing on my system. Can anyone help?

share|improve this question

marked as duplicate by Michael Hampton, mgorven, Shane Madden, Scott Pack, Iain Nov 18 '12 at 12:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

getaddrinfo is a library function in the standard C library, not a command line tool. So trying to execute it is not quite the right path to a solution. You can call getaddrinfo from a python shell if you want:

dennis@lightning:~$ python
>>> import socket
>>> socket.getaddrinfo('localhost', None)
[(2, 1, 6, '', ('', 0)), (2, 2, 17, '', ('', 0)), (2, 3, 0, '', ('', 0))]

but I doubt that this will help you solve your problem. Instead, follow the link in Michael's comment.

share|improve this answer
I was coming across this while searching for a getaddrinfo command line tool. Didn’t find any and use now python -c 'import socket; print(socket.getaddrinfo("", "ssh")[0][4][0])' for example – Robert Siemer Mar 28 '13 at 5:27

How do I fix "getaddrinfo: localhost Name or service not found" for telnet server?

I think this should help you. Had same problem and this is exactly what caused it (having some scripts as well which automatically set some DNS stuff).

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.