답변:
환경 변수 사용 HOSTALIASES:
환경 변수 정의 HOSTALIASES
export HOSTALIASES=~/.hosts
개인 hosts파일을 작성 하고 테스트 항목을 추가하십시오
echo 'myprivategoogle www.google.com' > ~/.hosts
테스트 시작
curl myprivategoogle
~/.hosts당신 의 항목이 없으면 얻을 것이다
curl: (6) Could not resolve host: myprivategoogle
당신이 가진 항목으로
<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>