I'm trying to configure some virtual hosts and I'm quite confused as to when this file is loaded.
At what point is /private/etc/hosts
loaded? When logging in? At every DNS call? When Mac OS restarts?
dnshosts
I'm trying to configure some virtual hosts and I'm quite confused as to when this file is loaded.
At what point is /private/etc/hosts
loaded? When logging in? At every DNS call? When Mac OS restarts?
Best Answer
The hosts(5) manual page provides some insight into how
/etc/hosts
is used.The file is used by
mDNSResponder
and, given your question, I suspect you want to see edits to/etc/hosts
reflected in your DNS look-ups.After each edit of
/etc/hosts
reset themDNSResponder
cache using this Apple technical note, OS X: How to reset the DNS cache:The note explains when you might need to do this: