4

I'm following this answer How do I get the mx records for a domain from *nix command line? but every time I get an error:

;; connection timed out; no servers could be reached

Error Image

Can anyone help to sort out this issue?

Thanks in advance.

Vaibhav Singhal
  • 171
  • 1
  • 1
  • 4

2 Answers2

4

That message occurs when dig/host/nslookup cannot get a response from the DNS servers configured for the system ( whatever is in /etc/resolv.conf). Basically: DNS isn't working at all on singhal right now.

You might (very dependent on a lot of local network considerations) be able to get a result from Google's own DNS servers, e.g.:

dig -t MX google.com @8.8.8.8

Craig Miskell
  • 4,216
  • 1
  • 16
  • 16
  • thanks... it works but in this case where I'm found the IP address like 8.8.8.8 – Vaibhav Singhal Aug 16 '17 at 10:07
  • 8.8.8.8 and 8.8.4.4 are Google's well-known public DNS servers, as described at https://en.wikipedia.org/wiki/Google_Public_DNS – Craig Miskell Aug 17 '17 at 19:14
  • lolz... if you know this IP or you can find out from other sources like Wikipedia then what's the purpose of this tool? – Vaibhav Singhal Aug 18 '17 at 15:35
  • 2
    I don't think you understand what's going on here. Your local DNS setup isn't working; I pointed you at a public recursive DNS server that you could use to see if the issue was local networking issues (e.g.your computer can't talk to *any* DNS server at all) or if it was local to your network. It looks like the latter. – Craig Miskell Aug 19 '17 at 22:29
  • lol... well then. – Katushai Nov 29 '17 at 04:18
0

I had the same issue after setting up a mail server on a VPS. I first noticed it after an email hard bounced with

Diagnostic-Code: smtp; 450 4.7.1 Client host rejected: cannot find your reverse hostname, [XXX.XXX.XXX.XXX]: retry timeout exceeded

I checked with host XXX.XXX.XXX.XXX on my server's IP address and got the same reply as OP :

;; connection timed out; no servers could be reached

Same with nslookup XXX.XXX.XXX.XXX :

** server can't find XXX.XXX.XXX.XXX.in-addr.arpa: SERVFAIL

I couldn't find much information on how to set it up, everything seemed find on the server side, so I asked my VPS provider, and they acknowledged that it had to be done on their side, which they did. It took about a day for the changes to be propagated, the next day host and nslookup found the reverse DNS / PTR.

So tl;dr : fixing this issue is probably the job of your VPS provider.

  • Related : https://serverfault.com/questions/208199/configuring-ptr-records https://serverfault.com/questions/344665/adding-ptr-to-dns https://serverfault.com/questions/654462/450-4-7-1-client-host-rejected-cannot-find-your-hostname – Skippy le Grand Gourou Mar 25 '21 at 21:23