Querying the DNS host

About this task

Query the DNS host for information about host addresses.

You can enter either a hostname, an IPv4 or IPv6 address. If you enter the hostname, this command shows the IP address that corresponds to the hostname and if you enter an IP address, this command shows the hostname for the IP address. DNS supports IPv4 and IPv6 addresses with no difference in functionality or configuration using CLI.

Procedure

  1. Enter Privileged EXEC mode:

    enable

  2. View the host information:

    show hosts WORD<0–256>

Example

Switch:1> enable

Switch:1# configure terminal

View the host information:

Switch:1(config)# show hosts 192.0.2.1

Variable Definitions

The following table defines parameters for the show hosts command.

Variable

Value

WORD<0–256>

Specifies one of the following:

  • the name of the host DNS server as a string of 0–256 characters.

  • the IP address of the host DNS server in a.b.c.d format.

  • The IPv6 address of the host DNS server in hexadecimal format (string length 0–46).