{
    "mode": "man",
    "parameter": "nslookup",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/nslookup/1/json",
    "generated": "2026-06-15T14:23:54Z",
    "synopsis": "nslookup [-option] [name | -] [server]",
    "sections": {
        "NAME": {
            "content": "nslookup - query Internet name servers interactively\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "nslookup [-option] [name | -] [server]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "nslookup  is a program to query Internet domain name servers.  nslookup has two modes: inter‐\nactive and non-interactive. Interactive mode allows the user to query name servers for infor‐\nmation about various hosts and domains or to print a list of hosts in a domain.  Non-interac‐\ntive mode prints just the name and requested information for a host or domain.\n",
            "subsections": []
        },
        "ARGUMENTS": {
            "content": "Interactive mode is entered in the following cases:\n\na. when no arguments are given (the default name server is used);\n\nb. when the first argument is a hyphen (-) and the second argument is the host name or Inter‐\nnet address of a name server.\n\nNon-interactive mode is used when the name or Internet address of the host to be looked up is\ngiven as the first argument. The optional second argument specifies the host name or  address\nof a name server.\n\nOptions  can also be specified on the command line if they precede the arguments and are pre‐\nfixed with a hyphen. For example, to change the default query type to host information,  with\nan initial timeout of 10 seconds, type:\n\nnslookup -query=hinfo  -timeout=10\n\nThe -version option causes nslookup to print the version number and immediately exit.\n",
            "subsections": []
        },
        "INTERACTIVE COMMANDS": {
            "content": "",
            "subsections": [
                {
                    "name": "host [server]",
                    "content": "This  command  looks up information for host using the current default server or using\nserver, if specified. If host is an Internet address and the query type is A  or  PTR,\nthe  name  of the host is returned. If host is a name and does not have a trailing pe‐\nriod (.), the search list is used to qualify the name.\n\nTo look up a host not in the current domain, append a period to the name.\n"
                },
                {
                    "name": "server domain | lserver domain",
                    "content": "These commands change the default server to domain; lserver uses the initial server to\nlook  up information about domain, while server uses the current default server. If an\nauthoritative answer cannot be found, the names of servers that might have the  answer\nare returned.\n\nroot   This command is not implemented.\n\nfinger This command is not implemented.\n\nls     This command is not implemented.\n\nview   This command is not implemented.\n\nhelp   This command is not implemented.\n\n?      This command is not implemented.\n\nexit   This command exits the program.\n"
                },
                {
                    "name": "set keyword[=value]",
                    "content": "This  command is used to change state information that affects the lookups. Valid key‐\nwords are:\n\nall    This keyword prints the current values of the frequently used options  to  set.\nInformation about the current default server and host is also printed.\n\nclass=value\nThis keyword changes the query class to one of:\n\nIN     the Internet class\n\nCH     the Chaos class\n\nHS     the Hesiod class\n\nANY    wildcard\n\nThe  class  specifies the protocol group of the information. The default is IN;\nthe abbreviation for this keyword is cl.\n\nnodebug\nThis keyword turns on or off the display of the full response packet,  and  any\nintermediate  response packets, when searching. The default for this keyword is\nnodebug; the abbreviation for this keyword is [no]deb.\n\nnod2   This keyword turns debugging mode on or off.  This  displays  more  about  what\nnslookup is doing. The default is nod2.\n\ndomain=name\nThis keyword sets the search list to name.\n\nnosearch\nIf  the  lookup  request  contains at least one period, but does not end with a\ntrailing period, this keyword appends the domain names  in  the  domain  search\nlist to the request until an answer is received. The default is search.\n\nport=value\nThis keyword changes the default TCP/UDP name server port to value from its de‐\nfault, port 53. The abbreviation for this keyword is po.\n\nquerytype=value | type=value\nThis keyword changes the type of the information query to value.  The  defaults\nare A and then AAAA; the abbreviations for these keywords are q and ty.\n\nPlease  note  that  it is only possible to specify one query type. Only the de‐\nfault behavior looks up both when an alternative is not specified.\n\nnorecurse\nThis keyword tells the name server to query other servers if it does  not  have\nthe  information.  The default is recurse; the abbreviation for this keyword is\n[no]rec.\n\nndots=number\nThis keyword sets the number of dots (label separators) in a domain  that  dis‐\nables searching. Absolute names always stop searching.\n\nretry=number\nThis keyword sets the number of retries to number.\n\ntimeout=number\nThis  keyword  changes the initial timeout interval to wait for a reply to num‐‐\nber, in seconds.\n\nnovc   This keyword indicates that a virtual circuit should always be used when  send‐\ning requests to the server.  novc is the default.\n\nnofail This  keyword  tries the next nameserver if a nameserver responds with SERVFAIL\nor a referral (nofail), or terminates the query (fail) on such a response.  The\ndefault is nofail.\n"
                }
            ]
        },
        "RETURN VALUES": {
            "content": "nslookup returns with an exit status of 1 if any query failed, and 0 otherwise.\n",
            "subsections": []
        },
        "IDN SUPPORT": {
            "content": "If  nslookup  has  been built with IDN (internationalized domain name) support, it can accept\nand display non-ASCII domain names. nslookup appropriately converts character encoding  of  a\ndomain  name  before sending a request to a DNS server or displaying a reply from the server.\nTo turn off IDN support, define the IDNDISABLE environment variable. IDN support is disabled\nif the variable is set when nslookup runs, or when the standard output is not a tty.\n",
            "subsections": []
        },
        "FILES": {
            "content": "",
            "subsections": [
                {
                    "name": "/etc/resolv.conf",
                    "content": ""
                }
            ]
        },
        "SEE ALSO": {
            "content": "dig(1), host(1), named(8).\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Internet Systems Consortium\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "2026, Internet Systems Consortium\n\n\n\n\n9.18.39-0ubuntu0.22.04.4-Ubuntu              2025-08-13                                  NSLOOKUP(1)",
            "subsections": []
        }
    },
    "summary": "nslookup - query Internet name servers interactively",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "dig",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/dig/1/json"
        },
        {
            "name": "host",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/host/1/json"
        },
        {
            "name": "named",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/named/8/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Query name servers for various domain records.",
        "examples": [
            {
                "description": "Query your system's default name server for an IP address (A record) of the domain",
                "command": "nslookup {{example.com}}"
            },
            {
                "description": "Query a given name server for a NS record of the domain",
                "command": "nslookup -type=NS {{example.com}} {{8.8.8.8}}"
            },
            {
                "description": "Query for a reverse lookup (PTR record) of an IP address",
                "command": "nslookup -type=PTR {{54.240.162.118}}"
            },
            {
                "description": "Query for ANY available records using TCP protocol",
                "command": "nslookup -vc -type=ANY {{example.com}}"
            },
            {
                "description": "Query a given name server for the whole zone file (zone transfer) of the domain using TCP protocol",
                "command": "nslookup -vc -type=AXFR {{example.com}} {{name_server}}"
            },
            {
                "description": "Query for a mail server (MX record) of the domain, showing details of the transaction",
                "command": "nslookup -type=MX -debug {{example.com}}"
            },
            {
                "description": "Query a given name server on a specific port number for a TXT record of the domain",
                "command": "nslookup -port={{port_number}} -type=TXT {{example.com}} {{name_server}}"
            }
        ]
    }
}