Resolve ip адресов в windows

I’m looking for a command line tool which gets an IP address and returns the host name, for Windows.

asked Oct 13, 2009 at 14:27

DouglasJose's user avatar

1

The command you are looking for is called nslookup, works fine for reverse lookups IFF someone has configured a reverse zone file, which they don’t always do.

Bruno Bieri's user avatar

answered Oct 13, 2009 at 14:29

Ward - Trying Codidact's user avatar

0

if all the above fails, and you are specifically looking for a Windows machine, you can use

nbtstat -a 192.168.1.50

The data returned will be all the NetBIOS records the machine has. The one with a <20h> record type will usually be the machine’s name.

answered Oct 13, 2009 at 16:32

Moose's user avatar

MooseMoose

1,6411 gold badge9 silver badges7 bronze badges

7

For many IP addresses you could just use ping -a, for example

ping -a 209.85.229.106

will return

Pinging ww-in-f106.google.com [209.85.229.106] with 32 bytes of data:

Reply from 209.85.229.106...........

answered Oct 13, 2009 at 14:44

Marko Carter's user avatar

Marko CarterMarko Carter

4,0921 gold badge30 silver badges38 bronze badges

4

If you use nslookup command with the IP address as its first argument will return the PTR record (the reverse entry) if it exists. For example:

nslookup 192.168.1.50

answered Oct 13, 2009 at 14:36

Kyle Brandt's user avatar

Kyle BrandtKyle Brandt

83.7k74 gold badges307 silver badges448 bronze badges

(tested under Windows 10 x64)

From command line:

FOR /F "tokens=2 delims= " %A in ('2^>NUL NSLOOKUP "%IP_ADDRESS%" ^| FINDSTR /C:": "') do ECHO %A

Within a script:

FOR /F "tokens=2 delims= " %%A in ('2^>NUL NSLOOKUP "%IP_ADDRESS%" ^| FINDSTR /C:": "') do ECHO %%A

Two (side)notes:

  • To supress NSLOOKUP errors you have to use 2^>NUL instead of 1^>NUL
  • I’ve used FINDSTR /C to extract the value after the four whitespace characters. As the four spaces only seem to exist for the Name: entry, this appears to be only way to make it work on other localized systems.

JimNim's user avatar

JimNim

2,78613 silver badges24 bronze badges

answered Jul 17, 2017 at 14:22

script'n'code's user avatar

script’n’codescript’n’code

1611 gold badge1 silver badge7 bronze badges

Use dig. A Windows port is available from the ISC here (look in the immediate download box for the link to the zip file). Here’s their man page reference for dig.

Ward’s point about the reverse lookup records often not getting created is very much true. Reverse lookups often do fail because many admins don’t bother creating the ptr records.

Marcello Miorelli's user avatar

answered Oct 13, 2009 at 14:35

squillman's user avatar

squillmansquillman

37.9k12 gold badges92 silver badges146 bronze badges

tracert might be an option.

tracert 10.12.190.51

Results in:

Tracing route to LAP8662.aus.int.example.com [10.12.190.51]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  LAP8662.aus.int.example.com [10.12.190.51]

Trace complete.

answered Dec 7, 2022 at 5:14

Fidel's user avatar

FidelFidel

3731 gold badge4 silver badges19 bronze badges

4

if you want to know the host-name in same network then please use another machine which have same network and use below commend
Ping -an ip addres

answered Jun 27, 2017 at 23:34

user422366's user avatar

1

psexec \192.168.0.65 hostname

DMHD006
hostname exited on 192.168.0.65 with error code 0.

answered Jul 25, 2019 at 8:29

Sahin's user avatar

1

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

  1. Use the Resolve-DnsName Cmdlet to Resolve IP Address From Hostname With PowerShell
  2. Use the Dns.GetHostAddresses Method to Resolve IP Address From Hostname With PowerShell

Resolve IP Address From Hostname With PowerShell

A hostname, such as www.example.com, identifies a website or host on the internet. IP addresses are assigned to host names.

Sometimes you may need to get an IP address from the hostname or vice-versa. It can be easily done with the help of PowerShell.

This tutorial will teach you to resolve the IP address from hostname or vice-versa using PowerShell.

Use the Resolve-DnsName Cmdlet to Resolve IP Address From Hostname With PowerShell

The Resolve-DnsName cmdlet performs a DNS name query resolution for the specified name.

The following command resolves a hostname delftstack.com.

Resolve-DnsName delftstack.com

Output:

Name                                           Type   TTL   Section    IPAddress
----                                           ----   ---   -------    ---------
delftstack.com                                 A      60    Answer     3.6.118.31
delftstack.com                                 A      60    Answer     3.6.18.84

As you can see, it prints other information along with the IP address. To get only IP addresses, use the following command.

(Resolve-DnsName delftstack.com).IPAddress

Output:

To resolve a hostname from the IP address, you can specify an IP address to the command.

Resolve-DnsName 3.6.118.31

Output:

Name                           Type   TTL   Section    NameHost
----                           ----   ---   -------    --------
31.118.6.3.in-addr.arpa        PTR    300   Answer     ec2-3-6-118-31.ap-south-1.compute.amazonaws.com

Use the Dns.GetHostAddresses Method to Resolve IP Address From Hostname With PowerShell

The GetHostAddresses method of Dns Class displays the IP addresses of the specified host.

The following example returns the IP addresses of the host delftstack.com.

[System.Net.Dns]::GetHostAddresses('delftstack.com')

Output:

Address            : 1410467331
AddressFamily      : InterNetwork
ScopeId            :
IsIPv6Multicast    : False
IsIPv6LinkLocal    : False
IsIPv6SiteLocal    : False
IsIPv6Teredo       : False
IsIPv4MappedToIPv6 : False
IPAddressToString  : 3.6.18.84

Address            : 527828483
AddressFamily      : InterNetwork
ScopeId            :
IsIPv6Multicast    : False
IsIPv6LinkLocal    : False
IsIPv6SiteLocal    : False
IsIPv6Teredo       : False
IsIPv4MappedToIPv6 : False
IPAddressToString  : 3.6.118.31

It displays additional information like Address, AddressFamily, ScopeID, and others. To print only IP addresses, run the command below.

[System.Net.Dns]::GetHostAddresses('delftstack.com').IPAddressToString

Output:

The GetHostEntry method resolves a hostname from the IP address.

[System.Net.Dns]::GetHostEntry('3.6.118.31')

Output:

HostName                                        Aliases AddressList
--------                                        ------- -----------
ec2-3-6-118-31.ap-south-1.compute.amazonaws.com {}      {3.6.118.31}

We hope this tutorial gave you an idea to resolve an IP address from the hostname or vice-versa in PowerShell.

I’m looking for a command line tool which gets an IP address and returns the host name, for Windows.

asked Oct 13, 2009 at 14:27

DouglasJose's user avatar

1

The command you are looking for is called nslookup, works fine for reverse lookups IFF someone has configured a reverse zone file, which they don’t always do.

Bruno Bieri's user avatar

answered Oct 13, 2009 at 14:29

Ward - Trying Codidact's user avatar

0

if all the above fails, and you are specifically looking for a Windows machine, you can use

nbtstat -a 192.168.1.50

The data returned will be all the NetBIOS records the machine has. The one with a <20h> record type will usually be the machine’s name.

answered Oct 13, 2009 at 16:32

Moose's user avatar

MooseMoose

1,6411 gold badge9 silver badges7 bronze badges

7

For many IP addresses you could just use ping -a, for example

ping -a 209.85.229.106

will return

Pinging ww-in-f106.google.com [209.85.229.106] with 32 bytes of data:

Reply from 209.85.229.106...........

answered Oct 13, 2009 at 14:44

Marko Carter's user avatar

Marko CarterMarko Carter

4,0921 gold badge30 silver badges38 bronze badges

4

If you use nslookup command with the IP address as its first argument will return the PTR record (the reverse entry) if it exists. For example:

nslookup 192.168.1.50

answered Oct 13, 2009 at 14:36

Kyle Brandt's user avatar

Kyle BrandtKyle Brandt

83.7k74 gold badges307 silver badges448 bronze badges

(tested under Windows 10 x64)

From command line:

FOR /F "tokens=2 delims= " %A in ('2^>NUL NSLOOKUP "%IP_ADDRESS%" ^| FINDSTR /C:": "') do ECHO %A

Within a script:

FOR /F "tokens=2 delims= " %%A in ('2^>NUL NSLOOKUP "%IP_ADDRESS%" ^| FINDSTR /C:": "') do ECHO %%A

Two (side)notes:

  • To supress NSLOOKUP errors you have to use 2^>NUL instead of 1^>NUL
  • I’ve used FINDSTR /C to extract the value after the four whitespace characters. As the four spaces only seem to exist for the Name: entry, this appears to be only way to make it work on other localized systems.

JimNim's user avatar

JimNim

2,78613 silver badges24 bronze badges

answered Jul 17, 2017 at 14:22

script'n'code's user avatar

script’n’codescript’n’code

1611 gold badge1 silver badge7 bronze badges

Use dig. A Windows port is available from the ISC here (look in the immediate download box for the link to the zip file). Here’s their man page reference for dig.

Ward’s point about the reverse lookup records often not getting created is very much true. Reverse lookups often do fail because many admins don’t bother creating the ptr records.

Marcello Miorelli's user avatar

answered Oct 13, 2009 at 14:35

squillman's user avatar

squillmansquillman

37.9k12 gold badges92 silver badges146 bronze badges

tracert might be an option.

tracert 10.12.190.51

Results in:

Tracing route to LAP8662.aus.int.example.com [10.12.190.51]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  LAP8662.aus.int.example.com [10.12.190.51]

Trace complete.

answered Dec 7, 2022 at 5:14

Fidel's user avatar

FidelFidel

3731 gold badge4 silver badges19 bronze badges

4

if you want to know the host-name in same network then please use another machine which have same network and use below commend
Ping -an ip addres

answered Jun 27, 2017 at 23:34

user422366's user avatar

1

psexec \192.168.0.65 hostname

DMHD006
hostname exited on 192.168.0.65 with error code 0.

answered Jul 25, 2019 at 8:29

Sahin's user avatar

1

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

Domain names or IP addresses on a local computer can be resolved by adding entries in the local hosts file on a computer. Entries in the local hosts file have the added advantage that the system can run the application server, even when disconnected from the network.

Contents

  • 1 What does it mean to resolve an address?
  • 2 How do I use CMD to resolve an IP address?
  • 3 How is a Web address resolved?
  • 4 How do you resolve a host?
  • 5 What does it mean to resolve domain?
  • 6 What does unable to resolve mean?
  • 7 How do I extract an IP address from a URL?
  • 8 How do I ping an IP address and name my computer?
  • 9 Who is reverse IP?
  • 10 What is resolve host?
  • 11 How do I change my IP address to DNS name?
  • 12 Which command can be used to resolve hostname to IP address?
  • 13 How do I clear my host cache?
  • 14 What is resolved IP?
  • 15 How does name resolution work?
  • 16 What is name resolution process?
  • 17 What does temporary failure in name resolution mean?
  • 18 What is a DNS server do?
  • 19 What does host name unresolved mean?
  • 20 Can I see where an IP address is from?

What does it mean to resolve an address?

Address resolution or name resolution is the process of acquiring a physical address from a machine or virtual address that a network node or computer peripheral has sent.A computer always requires a physical storage or memory address to point to in order to pass data around.

How do I use CMD to resolve an IP address?

Himanshu Yadav

  1. Click on Start button and type cmd in the search box. Press “Enter”.
  2. Windows command prompt will open.
  3. It will show you Yahoo FTP IP address.
  4. If you want to look up IP address of a website then type nslookup in the command prompt and press enter.
  5. Now enter the domain name of any website and press enter.

How is a Web address resolved?

Steps for Domain Resolution and URL Processing:
When we type a web address into a web browser, our computer needs to convert them into an IP address. So that it can contact our web server and delivers to you. This is called a forward lookup because we are converting a hostname into an IP address.

How do you resolve a host?

Fortunately, there do exists a few methods to rectify Resolving host error and this guide shall make you aware of just that.

  1. Delete DNS Cache.
  2. Switch to Public DNS.
  3. Reset IP Configuration.
  4. Refresh DNS Client.
  5. Disable Chrome’s AutoComplete Feature.
  6. Bottom Line: Chrome Fix Resolving Host.

What does it mean to resolve domain?

Domain Resolution Definition
Domain Resolution is a service that points the domain name to the website space IP so that people can easily access the website through the registered domain name. An IP address is a numeric address that identifies a site on the network.

What does unable to resolve mean?

This error means that the hostname you are trying to connect to cannot be resolved to an IP address.If you have verified that the hostname is correct, there may be a problem with your DNS server (or with your ISP’s DNS server, if you are a standalone user). It may be unable to resolve hostnames to IP addresses.

The simplest way to determine the IP address of a website is to use our DNS Lookup Tool. Simply go to the DNS Lookup Tool, type the website URL into the text entry, and select Lookup. You’ll notice the search yielded a list of IPv4 addresses that differ from the IPs shown using the other methods.

How do I ping an IP address and name my computer?

Press the WINDOWS + R keys. Type CMD in the Run line.
At the DOS prompt, type Ping computername or Ping ipaddress.

  1. If the Ping suffers timeout, there is a connection problem.
  2. Check the connection (cable, router, hub, switch).
  3. Run the Configuration Utility.

Who is reverse IP?

What is a Reverse IP Lookup? The technique known as Reverse IP Lookup is a way to identify hostnames that have DNS (A) records associated with an IP address. A web server can be configured to serve multiple virtual hosts from a single IP address. This is a common technique in shared hosting environments.

What is resolve host?

A “host” issue, in which the browser stalls during page loading and displays a “Resolving Host” message, is caused by Google’s DNS pre-fetching setting. The setting is intended to speed up navigation but can create “Resolving Host” errors unless it is disabled.

How do I change my IP address to DNS name?

This process is also known as DNS lookup, NSLOOKUP. The process of finding the host name (or domain name) from an IP address involves sending a message to the IP address and requesting the computer located at that IP address to return its name. Usually this will be the same as the domain name.

Which command can be used to resolve hostname to IP address?

nslookup is one of the primary UNIX commands to find the IP address from the hostname and again from hostname to IP address. Similar to ping you can also, use the nslookup command to find the IP address of Both localhost and remote host in any UNIX-based system.

How do I clear my host cache?

Android (8.0 Oreo)

  1. Open Chrome.
  2. In the left pane click ‘DNS’.
  3. In the right pane click Clear host cache.

What is resolved IP?

DNS (Domain Name Server) resolution is the process of translating IP addresses to domain names. When a profile is configured to look up all numeric IP addresses, Webtrends makes a call to the network’s DNS server to resolve DNS entries.In most cases, IP addresses can be translated into domain names.

How does name resolution work?

DNS translates domain names to IP addresses so browsers can load Internet resources. Each device connected to the Internet has a unique IP address which other machines use to find the device. DNS servers eliminate the need for humans to memorize IP addresses such as 192.168.

What is name resolution process?

Name Resolution is the process of resolving the name of a computer on a network into its network address. Name resolution is an important part of network communication because the logical names of hosts on the network must be resolved into their network addresses before communication can take place.

What does temporary failure in name resolution mean?

The “Temporary failure in name resolution” error occurs when the system cannot translate a website name into an IP address. While the error sometimes appears due to a lost internet connection, there are multiple reasons why it may show up on your system.

What is a DNS server do?

A DNS server – short for Domain Name System server – converts web addresses into IP addresses. Without a DNS server, you won’t be able to connect to any websites. If you’re having issues with your default DNS server, you can change it.

What does host name unresolved mean?

The error “host name unresolved” comes when the DNS server box entery in that PC is 0.0.0.0, So do type the DNS server ip in that PC, and run web browser, type DNS/IP.

Can I see where an IP address is from?

An IP address lookup determines the location of any IP address. The results provide quite a bit of information, including information the city, state/region, postal/zip code, country name, ISP, and time zone. Consequently, this data is used by various agencies to find the owner of an IPv4 or IPv6 address.

Windows XP has the Windows Firewall which can interfere with network traffic if not configured properly. You can turn off the Windows Firewall, if you have administrator privileges, by accessing the Windows Firewall applet through the Control Panel. If your application works with the Windows Firewall turned off then the problem is probably due to the settings of the firewall.

We have an application which runs on multiple PCs communicating using UDP/IP and we have been doing experiments so that the application can run on a PC with a user who does not have administrator privileges. In order for our application to communicate between multiple PCs we have had to use an administrator account to modify the Windows Firewall settings.

In our application, one PC is designated as the server and the others are clients in a server/client group and there may be several groups on the same subnet.

The first change was to use the functionality of the Exceptions tab of the Windows Firewall applet to create an exception for the port that we use for communication.

We are using host name lookup so that the clients can locate their assigned server by using the computer name which is composed of a mnemonic prefix with a dash followed by an assigned terminal number (for instance SERVER100-1). This allows several servers with their assigned clients to coexist on the same subnet. The client uses its prefix to generate the computer name for the assigned server and to then use host name lookup to discover the IP address of the assigned server.

What we found is that the host name lookup using the computer name (assigned through the Computer Name tab of the System Properties dialog) would not work unless the server PC’s Windows Firewall had the File and Printer Sharing Service port enabled.

So we had to make two changes: (1) setup an exception for the port we used for communication and (2) enable File and Printer Service in the Exceptions tab to allow for the host name lookup.

** EDIT **

You may also find this Microsoft Knowledge Base article on helpful on Windows XP networking.

And see this article on NETBIOS name resolution in Windows.

  • Resize linux partition from windows
  • Restore windows photo viewer скачать
  • Resize windows partition windows 10
  • Resampledmo dll windows 11 скачать
  • Reset windows search powershell script