nslookup command showing error "connection timed out, server not found"
Solution 1
I had an identical error and it proved to be because port 53 was not open in the OS firewall. Not opening 53 prevents correct DNS functionality.
Solution 2
You should switch to better learning material... Taking a look at the very basic syntax of nslookup
command line parameters (shown below) your 2nd example is asking to find the IP address of mail.yahoo.com
using a DNS server gatech.edu
. As the latter probably isn't responding to your request, you get a timeout.
nslookup [-option] [name | -] [server]
As for the possible reasons for the failure, there are several.
Possible reason 1:
As I noted above, gatech.edu
is not probably resolving to the IP address of a DNS server.
I took a look at the DNS records of the mentioned domain:
C:\>nslookup
> gatech.edu
Server: server.example.com
Address: xxx.xxx.xxx.xxx
Non-authoritative answer:
Name: gatech.edu
Address: 130.207.160.173
> set q=ns
> gatech.edu
Server: server.example.com
Address: xxx.xxx.xxx.xxx
Non-authoritative answer:
gatech.edu nameserver = dns3.gatech.edu
gatech.edu nameserver = dns1.gatech.edu
gatech.edu nameserver = dns2.gatech.edu
dns3.gatech.edu internet address = 168.24.2.35
dns1.gatech.edu internet address = 128.61.244.253
dns1.gatech.edu AAAA IPv6 address = 2610:148:1f00:f400::3
dns2.gatech.edu internet address = 130.207.244.81
dns2.gatech.edu AAAA IPv6 address = 2610:148:1f01:f400::3
So, gatech.edu
resolves to 130.207.160.173
(the 1st query), but the (main) DNS servers for the domain (2nd query) have different IPs.
Possible reason 2:
As @netniV pointed out in his comment, there might be a firewall restriction that is denying DNS resolution from other sources than whatever is the preferred DNS server for the domain you're in.
Related videos on Youtube
code_guidance
Updated on September 18, 2022Comments
-
code_guidance almost 2 years
I am working on linux fedora and trying to learn use of nslookup. I run the command nslookup. It showed me dns server. when i run
nslookup mail.yahoo.com
, it works fine in that case also. but when i try to access same website using any other server, for examplenslookup mail.yahoo.com gatech.edu
, it gives me error "connection timed out, server could be reached". I don't have idea what possibly wrong I am doing. Can anyone help in this regard. Thank you.-
zagrimsan over 8 yearsWhat learning material you are using in your learning? Taking a look at the very basic syntax of
nslookup
command line parameters your 2nd example is asking to find the IP address ofmail.yahoo.com
using a DNS servergatech.edu
. As the latter probably isn't responding to your request, you get a timeout. -
Jonas Köritz over 8 years@zagrimsan this should be an answer :)
-
-
netniV over 8 yearsIf he is using the name of a server rather than IP it has to do a DNS lookup to find the server and if your DNS is incorrect it won't find it regardless. Google IPs are dead easy to remember 8.8.4.4 and 8.8.8.8 which should always work as no DNS resolution is needed to get to the IP
-
zagrimsan over 8 years@netniV As the OP can do DNS lookup without specifying any server on command line, there must be a proper server configured e.g. in
/etc/resolv.conf
anyway, thus what you say is not the reason for the failure. Generally speaking, you're correct, sure. -
netniV over 8 yearsTrue. I was reading it on my phone and missed that first part, the other thing I should have mentioned is that his firewall/router may not allow DNS queries from just ANY source, which may also prevent the lookups from working.hence another reason for the time. For example, at my office I prevent just any machine doing DNS queries so you would actually get a timeout whether you use the DNS or IP address unless your one of a few specific servers.
-
zagrimsan over 8 years@netniV Good point. I took the liberty of including that as another possible reason for the result quoted by OP :) However, taking a look at the ns records for the domain (also shown in my updated answer), the command line just seems to have been trying to use incorrect server for DNS resolution.