Inilah perintahnya:
[17:31:13 root etc]# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
127.0.0.2 myweb.com
[17:31:25 root etc]# ping myweb.com
PING myweb.com (184.154.233.2) 56(84) bytes of data.
64 bytes from ns1.siteground278.com (184.154.233.2): icmp_seq=1 ttl=42 time=275 ms
64 bytes from ns1.siteground278.com (184.154.233.2): icmp_seq=2 ttl=42 time=273 ms
64 bytes from ns1.siteground278.com (184.154.233.2): icmp_seq=3 ttl=42 time=281 ms
^C
--- myweb.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 273.625/276.874/281.478/3.346 ms
ping myweb.com pada mesin tanpa networkmanager akan mendapatkan 127.0.0.2, tapi saya tidak yakin, ada yang punya ide tentang apa ini?
Saya menggunakan fedora 20.
@ Davidvidchchartz Sebagian besar distribusi Linux secara default menonaktifkan cache resolver. Namun, file host harus diprioritaskan.
—
Chris
myweb.com
sudah ada dalam cache klien resolver.