Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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: http://www.exratione.com/2012/05/a-mailserver-on-ubuntu-1204-postfix-dovecot-mysql/

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
add comment

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.

2 Answers

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, '', ('127.0.0.1', 0)), (2, 2, 17, '', ('127.0.0.1', 0)), (2, 3, 0, '', ('127.0.0.1', 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("www.domain.com", "ssh")[0][4][0])' for example –  Robert Siemer Mar 28 '13 at 5:27
add comment

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
add comment

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