Usando a variável de ambiente HOSTALIASES :
-
Defina a variável de ambiente
HOSTALIASESexport HOSTALIASES=~/.hosts -
Crie seu arquivo
hostsprivado e adicione uma entrada de testeecho 'myprivategoogle www.google.com' > ~/.hosts -
Iniciar um teste
curl myprivategooglesem a entrada em
~/.hostsque você receberiacurl: (6) Could not resolve host: myprivategooglecom a entrada que você tem
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>302 Moved</TITLE></HEAD><BODY> <H1>302 Moved</H1> The document has moved <A HREF="http://www.google.com/">here</A>. </BODY></HTML>