Skip to content

What is HOSTNAME Windows command?

The Windows hostname command allows users to display or alter the name of the computer. It is a useful tool for identifying and managing network connections.

HOSTNAME Syntax:

Terminal window
hostname [options] [parameter]

HOSTNAME Options:

OptionDescription
/?Displays help for the hostname command.

Parameters:

ParameterDescription
NewHostNameSpecifies the new host name for the computer.

HOSTNAME Command Usage Examples:

Display Hostname

Terminal window
hostname

Displays the hostname of the computer.

Set Hostname

Terminal window
hostname NewHostName

Sets the hostname of the computer to “NewHostName”.

Display IP Address of Hostname

Terminal window
hostname -i

Displays the IP address associated with the hostname of the computer.

Display DNS Domain Name

Terminal window
hostname -d

Displays the DNS domain name part of the FQDN (Fully Qualified Domain Name) of the computer.

Reset Hostname to Default

Terminal window
hostname

Resets the hostname of the computer to the default hostname.

How to use HOSTNAME?:

How do I use hostname in Windows?

To use the hostname command in CMD, execute the following command:

Terminal window
hostname

What is the purpose of the hostname command in Windows?

The hostname command in Windows is used to display the name of the current computer within a network.

Terminal window
hostname

How can I set a new hostname using CMD in Windows?

To set a new hostname in Windows CMD, you can use the following command:

Terminal window
hostname NewHostName

Is there a way to display the fully qualified domain name (FQDN) of the computer using the hostname command?

Yes, you can display the FQDN of the computer by running the following command:

Terminal window
hostname /f

Can I find the IP address associated with the hostname using CMD in Windows?

Yes, you can find the IP address associated with the hostname by using the following command:

Terminal window
hostname -i

How do I show all the available options and syntax for the hostname command in CMD?

To display all available options and syntax for the hostname command, you can use the following command:

Terminal window
hostname /?

Is it possible to clear the hostname of the computer using the CMD command?

Yes, you can clear the hostname of the computer by using the following command:

Terminal window
hostname ""

How do I display the NetBIOS name of the computer in Windows using the hostname command?

To display the NetBIOS name of the computer, you can use the following command:

Terminal window
hostname /n

Applications of the HOSTNAME Command

  • Display the current host name of the computer
  • Change the host name of the computer