Hello
The issue you’re experiencing might be due to the way your system is configured to resolve hostnames. By default, most systems will try to resolve hostnames to IPv4 addresses before trying IPv6.
Here are a few things you could try:
Check the Format of the IPv6 Address in the Hosts File: The IPv6 address should be written in the hosts file in the same format as an IPv4 address. For example: 2001:db8:1::1 example.com www.example.com.
Specify the Zone ID: If you’re using a link-local address (starts with fe80), you need to specify the zone ID. For example: fe80::215:afff:fec6:ea64%11 realhost. You can find the zone ID using the command netsh interface ipv6 show addresses.
Disable DNS over HTTPS (DoH) in Your Browser: If you’re using a browser like Firefox, it might be using DoH, which can bypass the hosts file. You can disable this option in the browser’s network settings.
Change Network Settings: You could try changing the DNS server to localhost (127.0.0.1) in your network connection properties.
Modify the /etc/netsvc.conf File: If you’re on a Unix-like system, you could try adding ‘hosts=local, local6, bind6’ to the /etc/netsvc.conf file. This entry causes the system to look at the host file’s IPv6 address for the hostname instead of the DNS server’s IPv4 addresses.