What is Windows command to convert machine name to ip address and vice versa?

53

18

I need to know the ip address of another machine in a lan network.

What is the Windows command for getting ip address from machine name and vice versa?

Bobs

Posted 2013-06-02T10:31:12.340

Reputation: 2 635

Answers

73

A machine with machine name "accounting" and ip "192.168.1.95"

IP -> Machine Name:

tracert 192.168.1.95

or

NBTSTAT  -a 192.168.1.95

Machine Name -> IP

nslookup accounting

or

ping accounting

Bobs

Posted 2013-06-02T10:31:12.340

Reputation: 2 635

1ping -a can also be used to convert IP to hostname – phuclv – 2018-08-17T06:38:53.057

16

in window 7 and later versions. to find ipv4 ip by hostname you can try following methods.

For ipv4 (192.168.1.2):

ping hostname -4

For ipv6 (0000:0000:0000:0000:0000):

ping hostname -6

Muhammad Amjad Ayub

Posted 2013-06-02T10:31:12.340

Reputation: 161