Domain name resolution problem, there is no local DNS service, why can I configure the domain name to access the local website?

want to understand a problem, that is, the principle of domain name resolution, is there any easy-to-understand explanation?

for example, when I use PHPstudy to develop a website, I don"t have a DNS service locally, but after configuring a virtual host, I can access it through a domain name. However, if other people"s computers in the local area network want to access my local website, they cannot access it through the domain name, so they can only access it through the IP point.

who will explain?


phpStudy directly modifies the local host, to point the corresponding domain name to your IP, so you can access it directly through the domain name. If other people in the local area network want to access according to the domain name, you need to ask them to modify the local host, to point the domain name to your IP;

.

the function of the Host file and how to modify the Host file
how to modify host


Local HOST files can speed up the resolution of a website. When a browser requests a website, the system will first look up the records in the HOST according to the domain name, and then request the DNS server in the network settings if not. So there have been incidents of hackers hijacking HOST before. The landlord can point the www.baidu.com to your own server, and you can see that the content of the website above www.baidu.com has been replaced, rather than the real Baidu official website. That's basically how it works.


change it locally to host
host where the local area network can be rerouted
the wide area network can be accessed by forwarding (frp,ngork) or (dynamic domain name resolution + router port mapping)

Menu