How can I name the IP address?

I am developing a web application using Tomcat. I want to specify a name (domain name), for example "google" to access my site.

How can i do this?

+3
source share
4 answers

If you only want to specify a fake domain name for demo purposes on your development computer, you can add a line to your hosts file (usually located in / etc / hosts on UNIX / Linux systems):

# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost

# My fake domain name for demo purposes
192.168.1.121   google.com   

Then, when you open the google.com domain name on your computer, it redirects you to the specified IP address.

, , . , .

, , - google.com, hosts.

Windows , , hosts ( ):

Windows XP/Vista/Windows7:

c:\windows\system32\drivers\etc\hosts
+5

, (DNS). RFC , , , wikipedia.

, registrar .

+2

, DNS- ( A, IP-) -, IP- . -, , 80 , .

- , DNS , .

+1
  • , .
  • You need to register a domain name and indicate it on your hosting

Most hosting companies provide both services, which means that you do not need to worry about “HOW” you do it.

0
source

Source: https://habr.com/ru/post/1744286/


All Articles