getaddrinfo: Name or service not known

Hi
  I have just tried using ActionMailer to send mail in rails.For that i
followed code from railcasts.And it worked also.But some times i am
getting the error
"getaddrinfo: Name or service not known"..Why this happens?

Please help
Sijo

http://blog.innerewut.de/2007/9/23/name-or-service-not-known