Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Sep 2008 16:06:41 -0700
From:      "Michael K. Smith - Adhost" <mksmith@adhost.com>
To:        "David Naylor" <naylor.b.david@gmail.com>, <freebsd-questions@freebsd.org>
Subject:   RE: /etc/hosts not working
Message-ID:  <17838240D9A5544AAA5FF95F8D52031604A63F67@ad-exh01.adhost.lan>
In-Reply-To: <200809112249.05138.naylor.b.david@gmail.com>
References:  <200809112249.05138.naylor.b.david@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--PGP_Universal_942AC050_94E5F121_C76402FC_ECD355DE
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: QUOTED-PRINTABLE

Hello David:

		_____________________________________________
		From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-questions=
@freebsd.org] On Behalf Of David Naylor
		Sent: Thursday, September 11, 2008 1:49 PM
		To: freebsd-questions@freebsd.org
		Subject: /etc/hosts not working
	=09

		* PGP Signed: 09/11/08 at 13:49:05

		Hi,

		I am trying to redirect a URL request to a different address but it appea=
rs=20
		that /etc/hosts is not doing the job.  Example:

		127.0.0.1  google.com

		The way I understand it is that by typing google.com in a web browser it=
=20
		should result in the local page being displayed.  It instead goes to the=
=20
		proper Google page. =20

		`ping google.com' actually pings 127.0.0.1 but `host google' returns the=
=20
		actual IP addresses for google. =20

		/etc/nsswitch.conf has `hosts: files dns' and host.conf has `hosts\n dns'

		Any idea why the system calls are not honouring /etc/hosts?

		Regards

		David

		* David Naylor <naylor.b.david@gmail.com>
		* 0xFF6916B2
	=09

man host shows that the host utility is specifically for DNS-resolved looku=
ps and looks at /etc/resolv.conf, not /etc/hosts

Regards,

Mike

--PGP_Universal_942AC050_94E5F121_C76402FC_ECD355DE
Content-Type: application/pgp-signature;
	name="PGP.sig"
Content-Transfer-Encoding: 7BIT
Content-Disposition: attachment;
	filename="PGP.sig"

-----BEGIN PGP SIGNATURE-----
Version: 9.9.0 (Build 397)

iQEVAwUBSMmkgfTXQhZ+XcVAAQglDgf8DaYjyQrmxJmKg7KibsorMfm82IKJ4e1s
cD/bI2pWRM5SKKutgdAfQHbZp5IjgkjiMtkS589GfYAm2LRdTMoN9uAtk6xzRBrj
8YZdLZsJBFsX+84oQ6n2fPTIBWsqYSq6Mwod/X7f+1bXSnM/WnqaMtgBz6F4dd7F
uc4fDzlW1gKkNLvVPXSLF4XeNsj4k+8alNJ5IAjEO9F72toPIBxubVhPtBQEP9AO
wK0cQF80qe7Ntuctm55ueY3sm0/NrlbX6cWIiDcQX43+T1JiXUPhJmYaIAn5q4yp
jdOJzeBbrxgJ+Y0JF65ZXG4YYKSNHtst0a9W/Xf7AmCZ9hmJ37Ifjg==
=9HvA
-----END PGP SIGNATURE-----

--PGP_Universal_942AC050_94E5F121_C76402FC_ECD355DE--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?17838240D9A5544AAA5FF95F8D52031604A63F67>