From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1593B198003 for ; Fri, 8 Mar 2013 13:40:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 81C75E072C; Fri, 8 Mar 2013 13:40:39 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3AA6FE068C for ; Fri, 8 Mar 2013 13:40:37 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id bn7so1967959ieb.25 for ; Fri, 08 Mar 2013 05:40:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type; bh=n6XxAkJxrmOrGgGOlcuace2/S8rmgKuPhIyQ6xV5DtU=; b=K4M9QZdqM69P1M2pHtvDXKk6wXJVrnYUp8hmZgJfmV/e/SoCImepi2gY1X3iX2HsYv j+OMqKLT2/ORV43RcwHOWsPEe7CR1ON5GMm06F0WV7KI9ACKGQfHF6TmxiXwyRThzbwo hfjZTlQd/ZU21xt867KMk3RsKsZJ+7tm1Gh1q2dyCzhi6k/ISQgMrvi1BezqwX4rU+Y8 o9+u9HqSmySJ+MZQ8f5XKJD7bQUwMbofc6+1vHBKqyYp4BoEnUkOpnXSux0/OaLmqaMR L0+Z9W+aFDBkn6tSKmOd4QrkGP4Ke9nh1ZsjHDXbL02DMlnuAH3diqglbH2jK2A6oYMP pD/g== X-Received: by 10.50.203.3 with SMTP id km3mr1675926igc.64.1362750037472; Fri, 08 Mar 2013 05:40:37 -0800 (PST) Received: from ?IPv6:2001:5c0:1400:a::735? ([2001:5c0:1400:a::735]) by mx.google.com with ESMTPS id ip2sm1786733igc.5.2013.03.08.05.40.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Mar 2013 05:40:35 -0800 (PST) Message-ID: <5139EA4D.1000606@gmail.com> Date: Fri, 08 Mar 2013 08:40:29 -0500 From: Michael Mol User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130222 Thunderbird/17.0.2 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] /etc/hosts include file? References: <51391398.1030100@gmail.com> <513930FF.6030003@gmail.com> <5139A21E.8060201@gmail.com> In-Reply-To: <5139A21E.8060201@gmail.com> X-Enigmail-Version: 1.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2RBRIDLDUKSMPUGXVTGGC" X-Archives-Salt: 41c57633-a237-4e9b-a9ae-dbce35605cdd X-Archives-Hash: bbb26a54b3100937e3dfc5e62f360b42 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2RBRIDLDUKSMPUGXVTGGC Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 03/08/2013 03:32 AM, Alan McKinnon wrote: > On 08/03/2013 02:29, Michael Mol wrote: >> On 03/07/2013 05:24 PM, Alan McKinnon wrote: >>> Anyone know if there's a way to get /etc/hosts to support the notion = of >>> an include file? I did my homework and found nothing, maybe someone e= lse >>> knows more. >>> >>> I really do need this, I have an app that discovers things on the >>> network and knows their address. This makes it's automated way into D= NS >>> but takes a few days, and another app needs to use the fqdn right now= =2E >>> So /etc/hosts is the way to go for the interim three days. >>> >>> I've worked around it by creating /etc/hosts.d/ containing a header a= nd >>> a data file. cat the two and redirect to /etc/hosts.d/hosts and the r= eal >>> hosts file is a symlink to that. It's a sub-directory as none of thes= e >>> apps run as root and only root can modiy the real hosts file. >>> >>> This works well enough, but a supported include mechanism would make >>> life so much simpler, not to mention easier for my colleagues to >>> understand what the blazes I set up :-) >> >> No, there's not an "include" directive. >> >> There are, however, two other ways to get hostnames recognized. >> >> The first is /etc/resolv.conf . You can point your host at a local DNS= >> server which is aware of the discovered hosts, and which forwards the >> rest of the queries. (This is how Samba 4's internal DNS server >> operates; anything it knows, it responds to. Everything else, it forwa= rds.) >> >> Read the manpage for resolv.conf...there's a lot of stuff in there >> you'll want to know as you start coping with IPv6. (And some useful >> stuff if you want to favor a particular IP range...) >=20 > And the day started off so well. Then you had to come along and mention= > IPv6.... :-) >=20 > IPv6 is wonderfully easy to use client-side and reasonably easy to plug= > into an existing network (the routers mostly know what to do already). > The fun starts when you need to write an app that tracks and does range= > allocations at ISP scale, all while keeping the PTRs in line too. Sadly= > for me, my team works in that area and such a magic app is one of our > deliverables My mouth is watering... >=20 > One day when I've climbed down off the walls and my fingernails have > grown back, I might be up to relating what it is taking to get that > done.... :-) I don't suppose you knew I'm a huge IPv6 advocate, and travel around my state giving free training sessions... I would absolutely love to hear about the problems you're facing. Further, I'd love to help you get past them...and can put you in touch with experts who might also be able to help. >=20 >> >> The second is /etc/nsswitch.conf . nsswitch.conf is how you inject >> samba-discovered, NIS-offered -- or whatever provider you care to inje= ct >> -- hostname databases into the system resolver. You could have it quer= y >> your provided database first, moving on to other sources if your >> provided database doesn't have what you're looking for. (I'm actually >> kinda surprised avahi doesn't come with an nss plugin...) >=20 > One day I should read nsswitch's man page completely. I never needed to= > know more than "dns files" for the hosts directives and that shadow doe= s > user. All those other lookup schemes are things I never use. I've never mucked with NIS, but I muck with samba from time to time. If you're already in a developer context, I'd suggest writing an NSS plugin the system resolver can check on. That's the angle I'd take in your circumstance. ------enig2RBRIDLDUKSMPUGXVTGGC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJROepPAAoJED5TcEBdxYwQIugH/3PLIx/CfzgK6z5l8RmQpxTw wD5GKffChbXdaZuCrRyymGn3y8snZg/2b8kCcviPunfJpZny/UHOfx+HCogpS8D3 GSv7FfL+8WeWDmKpYhyCU82fz3Z/EhcfEIS/WVVoLg9dsYRkc1lqoofMoF4UkK/G V6ghwNMcFkMQxYub/ca4bdmIGKbbzUmEruIQE6hnjCGqfzz/UjdVLO6cByeEhowz 7xCFZHPjkUSSUSMhaiEIvPry7ZxruYF+9qszMFDfduQV9pPL7xfdb6xIRjQVewv9 sBO7f2i/+ts5eBZKgPgdvMgksvIJhVLwsFgaCZF/tZ9elaposICaGhIjOfBIq4c= =R704 -----END PGP SIGNATURE----- ------enig2RBRIDLDUKSMPUGXVTGGC--