nslookup practical commands

Anyone who works in IT has run into a failed DNS request at least once, and it can be frustrating. In this post from the Avanetco blog series, we look at nslookup commands as a practical way to deal with that problem.
nslookup queries a DNS server and works on both Linux and Windows servers. It tells you whether a name server is authoritative and, if you want, returns a particular record. On Linux, if the command is not installed by default, install the bind-utils package.
A common case where nslookup is practical is after you set new name servers on your domain or change existing ones. Almost all servers on the internet use a TTL of 4 to 24 hours, so changes can take that long to take effect.
Once you are sure your domain status is active (not in client or server hold) and that time has passed, check your name server and see whether it responds to your requests:

If you receive “query refused”, either your name server is down or not working properly, or your domain does not exist in its zones.
nslookup server address_of_ns domain
Another practical use is checking whether a particular record exists on the name server. For example, to troubleshoot your mail server, you can check whether an MX record has been created for it:
nslookup server test.com set type=mx domain name
