/etc/hosts is the default:
MattBookPro:etc matt$ cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
MattBookPro:etc matt$ dig localhost
; <<>> DiG 9.6.0-APPLE-P2 <<>> localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51268
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;localhost. IN A
;; ANSWER SECTION:
localhost. 604800 IN A 127.0.0.1
;; AUTHORITY SECTION:
localhost. 604800 IN NS localhost.
;; ADDITIONAL SECTION:
localhost. 604800 IN AAAA ::1
;; Query time: 63 msec
;; SERVER: 192.231.203.132#53(192.231.203.132)
;; WHEN: Fri Oct 15 06:14:25 2010
;; MSG SIZE rcvd: 85
MattBookPro:etc matt$ ping localhost
ping: cannot resolve localhost: Unknown host
MattBookPro:etc matt$ ping localhost.
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.105 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.163 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.092 ms
^C
--- localhost ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.092/0.120/0.163/0.031 ms
MattBookPro:etc matt$
Interesting that appending the . makes it work. Indicates that it's trying to look for "localhost" in some other place and ignoring the /etc/hosts file doesn't it?
Message was edited by: Matthew Connolly3 - formatting