Microsoft Azure joins Collectives on Stack Overflow. Here's what the code looks like for retrieving the URL domain of a web page: JavaScript. See also: Can I perform a DNS lookup (hostname to IP address) using client-side Javascript? I did see your answer further in the thread and will check it out. host = System.Net.Dns.GetHostEntry(Request.ServerVariables.Item("REMOTE_HOST")) To extract the hostname portion from a URL, we can use the location object that represents information about the current URL. How to Shift Inline Elements When Text Bold on Hover using CSS ? network The solves the problem of a user being logged into two workstations at once. PHP | geoip_country_code_by_name() Function, PHP | Get PHP configuration information using phpinfo(). Many users will have the same ipaddress and the same user may not get the same ipaddress on a future request. How to place text on image using HTML and CSS? The location.host property returns the host (IP adress or domain) and port of a URL. How to position a div at the bottom of its container using CSS? This seems to work on Firefox, but newer Chrome versions don't run applets. An IP address is a combination of numbers that uniquely identifies one's system. myForm.macAddress.value=sMacAddr; I didn't realize i could do that. let hostname = location.hostname; Try it Yourself Definition and Usage The location.hostname property returns the host (IP adress or domain) of a URL. This paper implements it by other methods. These are the application services that fetch the users IP address and simply return it in three formats, ie., plain text, JSON, and JSONP format. Get hostname of client pc via javascript or jquery. How to detect operating system on the client machine using JavaScript ? Thanks heaps for your help! Letter of recommendation contains wrong name of journal, how will this hurt my application? Is there a way to get the user computer name using javascript? Find centralized, trusted content and collaborate around the technologies you use most. You will get this: Tick the box " SMB 1.0/CIFS Client ", and press OK! What you could do is create a server method that returns the computer name, and using Ajax call it instead. In this example we are going to see how to get client's address and hostname in a Servlet. Example 1: In this example, we will use the self URL, where the code will run to extract the hostname. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. Flags to modify the way the hostname is resolved. What is URL Locator & what are common schemes used for the URL in HTML ? In this article, we will know how to get the clients IP address in Javascript. To extract the hostname portion from a URL, we can use the location object that represents information about the current URL. Works only with http, not https, On JavaSide use the websocket implementation of http://java-websocket.org/, In Javascript I use https://code.google.com/p/jquery-websocket/ Edit: note, if you can it would be better (less HTTP requests) and easier to just include the host name in a dynamically generated