To display the domain name of the server, use the domain property with JavaScript.
Example
You can try to run the following code to show the domain name of the server that loaded the document −
<!DOCTYPE html> <html> <body> <script> var myDomain = document.domain; document.write("<br>Domain name of the server that loaded the document: "+myDomain); </script> </body> </html>