{
    "mode": "man",
    "parameter": "name2addr",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/name2addr/1/json",
    "generated": "2026-06-03T00:20:39Z",
    "synopsis": "addr2name [-46cmnr] [HOSTNAMES]\nname2addr [-46cn] [HOSTNAMES]",
    "sections": {
        "NAME": {
            "content": "addr2name, name2addr - perform DNS lookups from scripts\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "addr2name [-46cmnr] [HOSTNAMES]\n\nname2addr [-46cn] [HOSTNAMES]\n\n",
            "subsections": []
        },
        "DESCRIPTON": {
            "content": "Write  addresses or canonical hostname of specified names to the standard output. If no names\nare specified via the command line, they are read from the standard input.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-4 --ipv4",
                    "content": "Only try to perform IPv4 lookups.\n\n",
                    "flag": "-4",
                    "long": "--ipv4"
                },
                {
                    "name": "-6 --ipv6",
                    "content": "Only try to perform IPv6 lookups.\n\n",
                    "flag": "-6",
                    "long": "--ipv6"
                },
                {
                    "name": "-c --config",
                    "content": "Only lookup and print results for address families that match locally  configured  ad‐\ndresses  (If  the  system has no IPv4 resp IPv6 address, then IPv4 resp IPv6 addresses\nare ignored).\n\n",
                    "flag": "-c",
                    "long": "--config"
                },
                {
                    "name": "-h --help",
                    "content": "Display some help and exit.\n\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-m --multiple",
                    "content": "Normally, if a name yields multiple results, only the first one is printed.  With this\noptional parameter, all results will be printed on a single line, separated by spaces.\n\n",
                    "flag": "-m",
                    "long": "--multiple"
                },
                {
                    "name": "-n --numeric",
                    "content": "Prevent  forward  hostname  lookup.  This ensures that the input names are numeric ad‐\ndresses, which do not need to be looked up. Typically used along  with  the  --reverse\noption to convert numerical addresses to canonical hostnames.\n\n",
                    "flag": "-n",
                    "long": "--numeric"
                },
                {
                    "name": "-r --reverse",
                    "content": "Perform  a  reverse  DNS lookup (enabled implicitly with addr2name).  addr2name prints\nnumerical resolved addresses by default instead.\n\n",
                    "flag": "-r",
                    "long": "--reverse"
                },
                {
                    "name": "--version",
                    "content": "Display program version and license and exit.\n\n",
                    "long": "--version"
                }
            ]
        },
        "SEE ALSO": {
            "content": "host(1), getaddrinfo(3), getnameinfo(3), resolv.conf(5)\n\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Rémi Denis-Courmont <remi at remlab dot net>\n\nhttp://www.remlab.net/ndisc6/\n\n\n\naddr2name                                      $Date$                                   ADDR2NAME(1)",
            "subsections": []
        }
    },
    "summary": "addr2name, name2addr - perform DNS lookups from scripts",
    "flags": [
        {
            "flag": "-4",
            "long": "--ipv4",
            "arg": null,
            "description": "Only try to perform IPv4 lookups."
        },
        {
            "flag": "-6",
            "long": "--ipv6",
            "arg": null,
            "description": "Only try to perform IPv6 lookups."
        },
        {
            "flag": "-c",
            "long": "--config",
            "arg": null,
            "description": "Only lookup and print results for address families that match locally configured ad‐ dresses (If the system has no IPv4 resp IPv6 address, then IPv4 resp IPv6 addresses are ignored)."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Display some help and exit."
        },
        {
            "flag": "-m",
            "long": "--multiple",
            "arg": null,
            "description": "Normally, if a name yields multiple results, only the first one is printed. With this optional parameter, all results will be printed on a single line, separated by spaces."
        },
        {
            "flag": "-n",
            "long": "--numeric",
            "arg": null,
            "description": "Prevent forward hostname lookup. This ensures that the input names are numeric ad‐ dresses, which do not need to be looked up. Typically used along with the --reverse option to convert numerical addresses to canonical hostnames."
        },
        {
            "flag": "-r",
            "long": "--reverse",
            "arg": null,
            "description": "Perform a reverse DNS lookup (enabled implicitly with addr2name). addr2name prints numerical resolved addresses by default instead."
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Display program version and license and exit."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "host",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/host/1/json"
        },
        {
            "name": "getaddrinfo",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/getaddrinfo/3/json"
        },
        {
            "name": "getnameinfo",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/getnameinfo/3/json"
        },
        {
            "name": "resolv.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/resolv.conf/5/json"
        }
    ]
}