Nslookup Online Tool

Domain or IP Address

Query Type

DNS Server


About Nslookup Online Tool:

This online nslookup tool return dns lookup result from Linux server. You can choose the DNS query type (default type ALL), and query any five public DNS servers (default google public DNS server). Support Record Type:

Record Type Description
A Specifies a computer's IPv4 address
AAAA Specifies a computer's IPv6 address
CNAME Specifies a canonical name for an alias
MX Specifies the mail exchanger
NS Specifies a DNS name server for the named zone
TXT Specifies the text information
SOA Specifies the start-of-authority for a DNS zone
PTR Specifies a computer name if the query is an IP address
ANY Specifies a computer's all DNS Type record

comic nslookup

Nslookup with or without www prefix?

Notice: In most situation, nslookup with or without www prefix will work, but nslookup without www prefix often return more informations about the domain. This happens because of how the domain owners set up the DNS, and domain with www prefix is a secondary domain.

Why Nslookup?

Human use names for convenience, you probably can't remember "31.13.67.35" when you want to check your friend's social updates online, instead you will type "facebook.com" in the browser. Domain name is easier for human but not for machine, machine prefer to communicate with other machine by IP address. The second you click into facebook, your browser automatically do a NsLookup query and get the IP address "31.13.67.35".

NsLookup is the tool to translate human memorable domain name into machine readable IP Address. Although DNS is not limited to this, NsLookup can find domain's mail address, domain's IPv6 address, and so much more waiting for you to discover.

NsLookup is also used in professional field. In domain possession proven process, add a TEXT type DNS record can prove your possession of a domain (If you buy a domain from Godaddy, you can set up a DNS record in Godaddy's DNS server).

Hide your website DNS Record with Cloudflare:

Cloudflare can forward your website's traffic through their CDN (Global Content Delivery Network), replace your web server's real IP Address with Cloudflare's IP in the nslookup query result. It can be done by point your domain's authoritative DNS servers to Cloudflare's DNS server at your domain registrar.

Which DNS server should you use?

As you can learn above, the authority of DNS server is essential to the security of the Internet. Wrong DNS result might lead you to wrong website. There are 13 Root Servers located around the world with the highest authority. Meanwhile, large companies such as Google provide free public DNS services (8.8.8.8) for regular usage.

In default, if you don't set your default DNS server in your computer, your ISP (Internet service provider) will locate a random DNS server for you, though it might not work as well as Google's public DNS services (8.8.8.8). It's easy to set up and you definitely should change your computer's default DNS server to one of the public DNS servers.

More information about nslookup:

Wikipedia (DNS): https://en.wikipedia.org/wiki/Domain_Name_System

RFC 1035 (DNS): https://www.ietf.org/rfc/rfc1035.txt

nslookup in Linux: https://linux.die.net/man/1/nslookup

nslookup in Windows: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/nslookup

Nslookup Command in Linux:

NAME
       nslookup - query Internet name servers interactively

SYNOPSIS
       nslookup [-option] [name | -] [server]

root@instance-2:/var/log/apache2# nslookup -type=any facebook.com 8.8.8.8
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
facebook.com	nameserver = a.ns.facebook.com.
facebook.com	nameserver = b.ns.facebook.com.
facebook.com	text = "v=spf1 redirect=_spf.facebook.com"
facebook.com	mail exchanger = 10 msgin.vvv.facebook.com.
facebook.com
	origin = a.ns.facebook.com
	mail addr = dns.facebook.com
	serial = 1530053366
	refresh = 14400
	retry = 1800
	expire = 604800
	minimum = 300
Name:	facebook.com
Address: 2a03:2880:f12c:183:face:b00c:0:25de
Name:	facebook.com
Address: 157.240.14.35

Authoritative answers can be found from:
    

DNS Lookup with Python (with package dnspython):

# pip install dnspython
import dns.resolver


def nslookup(domain, record_type):
    dns_resolver = dns.resolver.Resolver()
    answers = dns_resolver.query(domain, record_type)
    for answer in answers:
        print('Domain:{0} Record Type:{1} Answer:{2}'.format(domain, record_type, answer))


if __name__ == "__main__":
    # dns lookup domain
    nslookup('coding.tools', 'A')

-------------------
Domain:coding.tools Record Type:A Answer:104.27.176.94
Domain:coding.tools Record Type:A Answer:104.27.177.94
    

DNS Lookup with Java (with package java.net.InetAddress):

import java.io.IOException;
import java.net.InetAddress;

public class DNS {
    public static void nslookup(String domain) throws IOException {
        InetAddress[] remote_hosts = InetAddress.getAllByName(domain);
        for (InetAddress remote_host : remote_hosts) {
            System.out.println("Domain:" + domain + " IP Address:" + remote_host.getHostAddress());
        }
    }

    public static void main(String[] args) throws IOException {
        // dns lookup domain
        nslookup("coding.tools");
    }
}

-------------------
Domain:coding.tools IP Address:104.27.176.94
Domain:coding.tools IP Address:104.27.177.94