nslookup query not working in Ubuntu

Parthapratim Neog

I am trying to use the code nslookup -q=mx gmail.com to find the mail server of gmail.com, but its not working on my Ubuntu. I have tried it in windows and it works fine. I can't find out what the issue on Ubuntu. The command nslookup gmail.com works though. Here are the responses of both commands;

Response for: nslookup gmail.com

thisisppn@thisisppn-HP-15-Notebook-PC:~$ nslookup gmail.com
Server:     127.0.1.1
Address:    127.0.1.1#53

Non-authoritative answer:
Name:   gmail.com
Address: 216.58.196.5

Response for: nslookup -q=mx gmail.com

thisisppn@thisisppn-HP-15-Notebook-PC:~$ nslookup -q=mx gmail.com
;; connection timed out; no servers could be reached
AzkerM

After a quick chat, I noted that the DNS entries causing you to resolve your queries. Adding DNS entries to /etc/resolv.conf made me clear that it is indeed the DNS.

Ways of adding DNS entries listed below.

Adding additional entries to resolv.conf

Create a file under /etc/resolvconf/resolv.conf.d/ as tail and add them there.

sudo nano /etc/resolvconf/resolv.conf.d/tail

and add nameserver 8.8.8.8 (or your preferred DNS). Once done, just restart the network manager with:

sudo service network-manager restart

Adding through network-manager

Edit Connections -> select your network (wired/wireless) and Edit -> IPv4 Settings -> and select Automatic (DHCP) address only -> add under Additional DNS servers

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事