0

I have several localhost entries on my local etc/host file. (in Mac "/etc/hosts" and in Windows "C:\Windows\System32\drivers\etc\hosts"

# LOCAL DEVELOPMENT
172.16.5.248 maxim.local
172.16.5.248 m.maxim.local

My Computer is connected to a VPN.

I want to know when I type "maxim.local" in my browser (i.e Chrome)

Will the request go to the VPN DNS server? or will request will be handle locally only?

mahen3d
  • 3,905
  • 12
  • 34
  • 55
  • 1
    **Will the request go to the VPN DNS server?** - No. That's the point of the hosts file. The name is resolved from the hosts file, not from your DNS server. – joeqwerty May 11 '21 at 20:22

1 Answers1

0

The hosts file usually takes precedence.

On Linux with glibc (which is likely what you have), the order is defined in /etc/nsswitch.conf. DNS resolution is handled either through the dns plugin or through the systemd plugin.

Simon Richter
  • 3,209
  • 17
  • 17