Can you tell me how you can automatically change the site address to ip? for example: I click on a link like www.site.ru/main, and 100.100.2.2/main opens
I think the author wants to replace the site with his content. The hosts file is responsible for site names on the user's computer, it has priority over all DNS servers. You can also register name-to-address mappings on your DNS server.