/etc/hosts completely ignored
Roberto Nunnari
nunnari at die.supsi.ch
Wed May 28 10:24:33 PDT 2003
Dear Fred,
if I call
-bash-2.05b# host localhost.
localhost has address 127.0.0.1
but that's only because the dns specified in resolv.conf
answers the query with its own 'localhost' entry. Look:
-bash-2.05b# host -d -t A localhost.
;; res_nmkquery(QUERY, localhost, IN, A)
;; res_send()
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64429
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; localhost, type = A, class = IN
;; Querying server (# 1) address = 195.190.166.166
;; new DG socket
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64429
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; localhost, type = A, class = IN
localhost. 1D IN A 127.0.0.1
rcode = 0 (Success), ancount=1
localhost has address 127.0.0.1
its a remote dns that answers the query.. but naturally it doesn't
know about localhost in a not existant domain as
localhost.noonlights.net that I use for my private network
-bash-2.05b# host -d -t A localhost.noonlights.net.
;; res_nmkquery(QUERY, localhost.noonlights.net, IN, A)
;; res_send()
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20386
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; localhost.noonlights.net, type = A, class = IN
;; Querying server (# 1) address = 195.190.166.166
;; new DG socket
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 20386
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; localhost.noonlights.net, type = A, class = IN
net. 2D IN SOA a.gtld-servers.net.
nstld.verisign-grs.com. (
2003052800 ; serial
30M ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
rcode = 3 (Non-existent domain), ancount=0
Host not found.
Best regards.
--
Roberto Nunnari -software engineer-
mailto:nunnari at die.supsi.ch
Scuola Universitaria Professionale della Svizzera Italiana
Dipartimento di Informatica e Elettronica
http://www.die.supsi.ch
SUPSI-DIE
Via Cantonale tel: +41-91-6108561
6928 Manno """ fax: +41-91-6108570
Switzerland (o o)
=======================oOO==(_)==OOo========================
More information about the freebsd-current
mailing list