-1

i am trying to send a mail using netcat, and i am getting an error:

nc: getaddrinfo: Name or service not known

this is the command i am using

/usr/bin/nc smtp.xxxxx.yy 25 < test.txt

this is the content of test.txt

xxx.yyy.zz
MAIL FROM:<xxx@yyy.zz>
RCPT TO:<xxx@yyy.zz>
DATA
From: [xxx.yy] <xxxx@yyy.zz>
To: <xxx@yyy.zz>
Date: Mon, 2 Nov 2015 20:32:26 -0400
Subject: Test Message

This is a test !

Have a good day!
Frogg

.

QUIT

the system is ESXI 5.5

Froggiz
  • 3,043
  • 1
  • 19
  • 30
  • To Womble : error message, command and system are present in the question / To Jeeny D & Ward : NetCat is a way to send mail, in this case used to send backup result cause Esxi doesn't have intregated mail system. + tags i used are available in serverfault + trouble was firewall linked, so what should i changed in this post ? – Froggiz Nov 04 '15 at 10:54

1 Answers1

2

Netcat (nc) is telling you that it can't resolve the name "smtp.xxxxx.yy". That's what nc: getaddrinfo: Name or service not known means.

To verify that this is the issue, I'd suggest entering the IP of your SMTP server manually in your nc command instead of the domain name. If that works, then it's definitely a DNS issue.

To see what's going wrong in DNS, try running nslookup smtp.xxxxx.yy. This will show you what the DNS server thinks the correct IP is. I'm expecting that it will return one of the two following messages.

Scenario 1 - No DNS servers are configured, or are not reachable by the EXSi host:

nslookup foo.bar.baz
;; connection timed out; no servers could be reached

Scenario 2 - DNS server configured and reachable, but requested domain name is not valid

carbon:~ % nslookup foo.bar.baz
Server:     8.8.8.8
Address:    8.8.8.8#53

** server can't find foo.bar.baz: NXDOMAIN

Here's a VMWare KB article on the topic of troubleshooting DNS issues.

  • thanks, nslookup shown me smtp wasn't reachable, i had to change firewall rules to allow smtp request (after i got more trouble with anonymous request, but AUTH LOGIN solved the trouble ..but thats another story !) – Froggiz Nov 03 '15 at 14:32