{"id":801,"date":"2006-05-27T15:25:51","date_gmt":"2006-05-27T19:25:51","guid":{"rendered":"http:\/\/wordpress.cephas.net\/?p=801"},"modified":"2006-05-27T15:25:51","modified_gmt":"2006-05-27T19:25:51","slug":"using-a-hosts-file-on-os-x","status":"publish","type":"post","link":"https:\/\/cephas.net\/blog\/2006\/05\/27\/using-a-hosts-file-on-os-x\/","title":{"rendered":"Using a HOSTS file on OS X"},"content":{"rendered":"<p>In the Windows world it&#8217;s a reasonably straightforward process to add pseudo domain names using the HOSTS file usually located in c:\\windows\\system32\\drivers\\etc\\.  Open the file, add a name \/ IP address entry, save the changes and you&#8217;re off and running. It&#8217;s slightly more involved on OS X as <a href=\"http:\/\/www.macwrite.com\/criticalmass\/mac-os-x-hosts-regrouped.php\">this site<\/a> details.  OS X uses <a href=\"http:\/\/developer.apple.com\/documentation\/Darwin\/Reference\/ManPages\/man8\/lookupd.8.html\">lookupd <\/a>to do name resolution and by default (at least on my machine) it is configured to look to a DNS server before referencing the local HOSTS file, which is <a href=\"http:\/\/support.microsoft.com\/default.aspx?scid=kb;EN-US;172218\">not how Windows works<\/a>. Turns out it&#8217;s reasonably easy to change (as detailed on the macwrite.com link mentioned above):<br \/>\n<code><br \/>\ncd \/etc<br \/>\nsudo mkdir lookupd<br \/>\ncd lookupd<br \/>\nls<br \/>\ncp hosts hosts.original<br \/>\nsudo echo LookupOrder Cache FF NI DNS DS &gt; hosts<br \/>\nsudo kill -HUP 'cat \/var\/run\/lookupd.pid'<br \/>\n<\/code><br \/>\nAfter that&#8217;s done, you can add \/ delete \/ modify domain name to IP address mappings using the <a href=\"http:\/\/www.oreillynet.com\/cs\/user\/view\/cs_msg\/18893\">NetInfo Manager tool<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Windows world it&#8217;s a reasonably straightforward process to add pseudo domain names using the HOSTS file usually located in c:\\windows\\system32\\drivers\\etc\\. Open the file, add a name \/ IP address entry, save the changes and you&#8217;re off and running. It&#8217;s slightly more involved on OS X as this site details. OS X uses lookupd &hellip; <a href=\"https:\/\/cephas.net\/blog\/2006\/05\/27\/using-a-hosts-file-on-os-x\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Using a HOSTS file on OS X<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[28,12],"tags":[],"_links":{"self":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/801"}],"collection":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/comments?post=801"}],"version-history":[{"count":0,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/801\/revisions"}],"wp:attachment":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/media?parent=801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/categories?post=801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/tags?post=801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}