How to find server name command?
How to find the name of the server where my pc running?
I have an IP which is in many computers around the world. When I was trying to find the name of that computer ,is there any command which return the name or ip and country? The short answer is, you can't. The way names work is in the context of an internet domain (a "sub-domain" as is often called). An example of a domain might be "example.com" and what they would know would be your public IP address. Once the server responds, with its public IP address, that's it for name resolution.
In fact if you were able to contact the server directly, it could also be possible to see where it lives (a web server may be hosted on another computer in another part of the world) but in general that isn't very useful to the typical user, who has no idea where the server lives. It isn't really possible to tell where a system is from the data being transmitted, since different routing networks are used. And a private system in Canada doesn't really have any reason to talk to a server in India that has it's own local private network, except that the server has to respond to a specific port in order for the connection to function. You could find out more by looking at the ARP cache which is maintained on routers (see, for instance, ARP poisoning), but again, that wouldn't really tell you where the person actually lives.
How to get server name from URL in cmd?
I am trying to create an URL and then use it as a parameter in my curl call. The code I am using is below: FOR /F "delims= " %%A IN ('dir /b/s/a-d %1.txt') DO ( FOR /F "tokens=1,2 delims=." %%B IN ("%%A") DO ( CALL :processURL %%B. Set param1=%1. Echo %param1%. The problem I am having is that when I execute the code above the output is: url.com/directory/folder The output I want is: The command I am executing is a cron job that runs every minute and it is calling an external web service. Thanks in advance for the help. To set the variable %1 to the text before the / you can use this (or something like this): FOR /F "delims= " %%A IN ('dir /b/s/a-d "%~1.txt"') DO (
How to get server name from IP address?
I'm trying to get the server name based on a IP address.
I've tried the following: public String getServerName(String ipAddress) throws UnknownHostException. And I also tried: public String getServerName(String ipAddress) throws UnknownHostException. I can't find a way to do this. Any ideas how to accomplish this? For example if you are running the java server code on localhost it will look for the DNS name like "localhost". If you run a J2EE application on your local machine the server will try to find the appropriate server hostname to use. In that case if your server code is running on localhost it will check your HOSTS file for the hostname like "localhost" and try to find a DNS hostname corresponding to localhost.
To find the name from a given ip address you need to first know where your HOSTS file is located and then search for the name in the file.
Related Answers
What is the domain name server?
Domain name server is a small program (server) on a personal c...
What is a proxy server and why do I need it?
A proxy server is a server computer that makes web connections...
What is an example of DNS?
The perfect question for a Webmaster! The Domain...