- Resolve host name to an ip address
- 5 Answers 5
- How to find IP Address from hostname in Windows Linux and Unix
- Finding IP address from hostname in UNIX and Linux
- 1) IP address using hostname command in Unix/Linux
- 2) IP address using ping command in UNIX or Linux
- 3) IP address using nslookup command in UNIX or Linux
- 4) How to find the IP address using the ifconfig command
- IP Address from hostname in Windows Linux and Unix
- Now, let’s see some examples to convert hostname to IP address in Windows, Linux, and other UNIX based systems.
- 1. How to find the IP address of your computer in Windows
- 2. How to find the external IP address of your network or computer
- 11 comments :
- 8 ways to find your IP address in Windows (all versions)
- 1. How to find your IP address from the Command Prompt (all versions of Windows)
- 2. How to find your IP address in the Settings app (Windows 10 only)
- 3. How to find your IP Address in the Control Panel (all versions of Windows)
- 4. How to find your IP address in System Information (all versions of Windows)
- 5. How to find the IP address in PowerShell (all versions of Windows)
- 6. How to find your IP address in Task Manager (Windows 10 and Windows 8.1 only)
- 7. How to find your computer’s IP address using the Network Map (Windows 7 only)
- 8. How to find your IP address in the PC Settings app (Windows 8.1 only)
- Conclusion
Resolve host name to an ip address
I developed a client/server simulation application. I deployed client and server on two different Windows XP machines. Somehow, the client is not able to send requests to the server.
I tried below options:
Pinged server machine successfully from client using ip-address.
Pinged client machine successfully from server using ip-address.
Checked netstat command line tool from both machines. Server is in LISTENING mode and client is in SYS_SENT mode. But the foreign address it is using to send is host name not the ip address.
Pinged server machine unsuccessfully using host name from client.
Pinged client machine successfully using host name from server.
I feel the problem is when the client is trying to connect to the server using the host name.
Could you please let me know how to force an application to use an ip address instead of a host name? Is there any other way to map the host name to an ip address?
5 Answers 5
Go to your client machine and type in:
substituting the real host name of your server for server.company.com , of course.
That should tell you which DNS server your client is using (if any) and what it thinks the problem is with the name.
To force an application to use an IP address, generally you just configure it to use the IP address instead of a host name. If the host name is hard-coded, or the application insists on using a host name in preference to an IP address (as one of your other comments seems to indicate), then you’re probably out of luck there.
However, you can change the way that most machine resolve the host names, such as with /etc/resolv.conf and /etc/hosts on UNIXy systems and a local hosts file on Windows-y systems.
Try tracert to resolve the hostname. IE you have Ip address 8.8.8.8 so you would use; tracert 8.8.8.8
You could use a C function getaddrinfo() to get the numerical address — both ipv4 and ipv6. See the example code here
This is hard to answer without more detail about the network architecture. Some things to investigate are:
- Is it possible that client and/or server is behind a NAT device, a firewall, or similar?
- Is any of the IP addresses involved a «local» address, like 192.168.x.y or 10.x.y.z?
- What are the host names, are they «real» DNS:able names or something more local and/or Windows-specific?
- How does the client look up the server? There must be a place in code or config data that holds the host name, simply try using the IP there instead if you want to avoid the lookup.
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.
How to find IP Address from hostname in Windows Linux and Unix
Finding IP address from hostname in UNIX and Linux
1) IP address using hostname command in Unix/Linux
2) IP address using ping command in UNIX or Linux
/test ping trading_system
3) IP address using nslookup command in UNIX or Linux
/test nslookup trading_system
4) How to find the IP address using the ifconfig command
IP Address from hostname in Windows Linux and Unix
Now, let’s see some examples to convert hostname to IP address in Windows, Linux, and other UNIX based systems.
1. How to find the IP address of your computer in Windows
2. How to find the external IP address of your network or computer
11 comments :
Incoming Search term
lan ping determine ip of hostname
get hostname ip addresses java linux
get ip from hostname linux
search hostname of a machine
how to find hostname unix hostname
how to get computername from ip address
how to find ip for hostname in lan
how to find hostname on linux
display hostname ip address
find ip address from hostname in windows
finding remote computer name linux
get ip address from hostname windows
get ip from hostname windows
get the exact ip address via ifconfig for a specific device in windows
host name to ip windows
how to find ip address and host name
how to find ip address in unix
how to find ip address of an hostname
linux find address for host name
unix command to my ip address
unix find ip from hostname
bash script for ip address from hostname
December 2, 2011 at 7:27 AM heera said.
Thanks . I was looking for exact same information, command to find hostname from ip address. we have linux machines in our lan network and I just joined. this unix tips will surely help me lot.
December 4, 2011 at 11:57 PM unixman said.
hostname -i will not work to find IP address of another computer, it will only work for current host. I think only available option to get IP address of another computer is «nslookup»
December 5, 2011 at 8:56 PM Anonymous said.
how to check the loction of my friend while chatting.
please help me one of my friend told me he is in us but i think he is telling lie so please help me to guess from where he is calling .
send the answer at papadonpart2@gmail.com
January 3, 2012 at 5:22 AM Jimm said.
how to find IP address in Unix operating system which doesn’t have nslookup command ? is there way to determine IP address without using nslookup
January 10, 2012 at 5:15 PM King said.
Thanks for this. i was looking for this «nslookup» command
May 30, 2012 at 2:05 AM Anonymous said.
Hello Javin, How will you convert an IP address to Hostname in Java? Can you please write about that? Thank you sir.
July 17, 2013 at 11:15 PM Samir said.
I am using linux system for my office work first time even though I have hosted all my website at linux hosting servers. There are few things I should have learned before like you let us know about ip host, pinging commands at linux system. I am a fast leaner yet I think it will take a month to get used to it as always typed wrong command and right click is something which we always used at windows.
July 24, 2013 at 1:38 AM Anonymous said.
You can also use ‘host’ command to display IP address associated with any DNS name (or hostname). It’s a DNS lookup utility similar to nslookup but it doesn’t print name of DNS server used to resolve addresses. In fact, host command output is much cleaner than nslookup, you will see something like this
host yahoo.com
yahoo.com has address 130,.40.23.19
yahoo.com has address 130,.40.23.29
It will print all IP address associated with a DNS name and registered in DNS server.
August 4, 2015 at 8:03 PM Anonymous said.
@Anonymous, indeed I would prefer host and nslookup any day than other commands, but you should aware that there is something called nscd which keeps a cache of most used queries on naming server. If a host got IP address change but still resolving to old IP address then this is one place you should check. Sometime name server can also be faulty.
8 ways to find your IP address in Windows (all versions)
The IP address or Internet Protocol address is a numerical label that is used in networks to identify and locate network devices, from computers to smartphones, to printers and other devices. The IP address can be a useful piece of information, especially when you want to set up your home router or when you want to connect to other devices on a network. But how do you check a PC’s IP address in Windows? In this tutorial, we will show you eight methods that work in Windows 10, Windows 7 and Windows 8.1:
NOTE: The information shared in this tutorial applies to all modern Windows operating systems: Windows 10, Windows 8.1 and Windows 7. To make things simpler, we use screenshots taken mostly in Windows 10. If you want to learn more technical details about IP addresses and their role in networking, we recommend you to read these articles:
1. How to find your IP address from the Command Prompt (all versions of Windows)
Open the Command Prompt , type the command ipconfig and press Enter. This command lists all the network adapters (both Ethernet and wireless) found on your Windows computer, and it shows details about each of them.
For each network adapter, you get to see both the IPv4 address and the IPv6 Address.
To learn more about the parameters accepted by the ipconfig command and what each of them does, run the command ipconfig /?.
And, if you are interested in finding more information about other networking commands that you can run using the Command Prompt, check this tutorial: Command Prompt – Advanced networking commands .
2. How to find your IP address in the Settings app (Windows 10 only)
If you are using Windows 10, open the Settings app . There, go to Network & Internet. You are shown a list of networking related settings and categories. If you are connected to a wireless network, in the column on the left, choose Wi-Fi and then, on the right, click or tap on the name of the network that you are connected to.
You are shown a long list of properties. Scroll down until you find the fields for the IPv6 and IPv4 addresses, highlighted below.
If you are connected using a network cable, in the column on the left choose Ethernet and then click or tap on the network name, on the right side of the screen.
Scroll down the list of network properties until you find the entries for the IPv6 and IPv4 addresses, highlighted below.
Now you can close the Settings app.
3. How to find your IP Address in the Control Panel (all versions of Windows)
Another geeky method that does not involve using a command is to use the Network and Sharing Center. To access it, open the Control Panel and go to “Network and Internet -> Network and Sharing Center.” If you want to learn more about it, read this guide: Simple questions: What is the Network and Sharing Center in Windows? . Next, click or tap the “Change adapter settings” link on the left.
The Network Connections window is opened, listing the network adapters installed on your computer, including virtual ones, used by VPN services or virtualization apps. Double click (or double tap) the network adapter for which you want to see the IP address.
This action opens the Status window of that adapter. Click or tap the Details button to see a series of details about that network adapter, including its IPv4 and IPv6 addresses.
Scroll through the list of details until you find the IPv4 and IPv6 address fields, highlighted below.
When done, Close the windows you just opened.
4. How to find your IP address in System Information (all versions of Windows)
Another method that works in all versions of Windows is to use the System Information desktop app. You can open it by using search and typing “System Information“ in the appropriate search field and clicking on the search result with the same name. Learn more about this tool and how to open it, from this guide: System Information – How to learn your PC’s complete configuration .
In the System Information desktop app, on the column on the left, expand Components followed by Networks and then Adapter. On the right side of the app window, you can see detailed information about each network adapter that is found on your computer. Scroll down the list until you find the network card that you are interested in. There you see a field named IP Address, giving you all the information you need.
Close the System Information app when done.
5. How to find the IP address in PowerShell (all versions of Windows)
PowerShell is a tool similar to the Command Prompt, but it is even more powerful and allows you to work with more elements that make up Windows. PowerShell has two commands which you can use to find the IPv4 and IPv6 address of a network adapter. The first one is gip. Type it in PowerShell and then press Enter. The command triggers the display of several details about each network adapter, including their IP addresses.
Another command which returns the same results is Get-NetIPConfiguration. Type it, press Enter and then look for the information that you want.
Close PowerShell when done.
6. How to find your IP address in Task Manager (Windows 10 and Windows 8.1 only)
If you use Windows 10 or Windows 8.1, start the Task Manager . If it starts in the compact view that only displays open apps, click or tap “More details.” Next, select the Performance tab and look for your network card. If you are connected to a wireless network, click or tap Wi-Fi. On the right side, you can see the IPv6 and IPv4 addresses.
If you are connected to a wired network, choose Ethernet on the left side of the Performance tab. On the right side look for the IPv6 and IPv4 addresses.
Close Task Manager when done.
7. How to find your computer’s IP address using the Network Map (Windows 7 only)
Windows 7 has a unique feature that is not available in Windows 8.1 or Windows 10. It is called the Network Map, and it shares a visual map of your network. If you want to find more about it, we recommend that you read this article: The Network Map – Access your network computers in a fun way . First, open the Network and Sharing Center. On the top right of the window, there is a link called “See full map.” Click on it.
This opens the Network Map. If you hover with the mouse over your computer, networking related information will be displayed, including the IPv4 and IPv6 address.
Write it down and close the Network Map.
8. How to find your IP address in the PC Settings app (Windows 8.1 only)
If you are using Windows 8.1, open the PC Settings app . There, choose Network and then go to Connections. Here you can see the network adapter that you are using the name of the network that you are connected to. Click or tap on the network name, under Ethernet (if you are on a wired connection) or Wi-Fi (if you are using a wireless network).
You are shown the properties of your connection, including the IP address.
Close PC Settings when done.
Conclusion
Finding the IP address of your Windows computer provides information that can be useful in many networking situations. If you know of other ways to find the IP address in Windows, or if you have questions regarding this subject, do not hesitate to leave a comment below.