3

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?

0

2 Answers 2

4

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.

1
  • 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 Mar 28, 2013 at 5:27
0

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).

Not the answer you're looking for? Browse other questions tagged .