[GRLUG] Persistant search domain

Roger Roelofs roger.roelofs at gmail.com
Wed Mar 28 23:33:06 EDT 2012


This is just a guess, but

On my system, resolv.conf can be rewritten by dhcpd, but
resolv.conf.head and resolv.conf.tail are included in the rewritten
resolve.conf so you can put static configs there and they will be
included on every rewrite.


On Wed, Mar 28, 2012 at 11:16 PM, Nathan Phillip Brink <binki at gentoo.org> wrote:
> On Wed, Mar 28, 2012 at 09:41:48PM -0500, L. V. Lammert wrote:
>> > We can't help you if we can't guess what's causing your search domain
>> > to be updated. I suppose we could assume you're using a relatively
>> > default installation of dhcpcd... but telling us your distro,
>> > etc. would eliminiate some of this guessing.
>> >
>> Ahh, .. does nobody use WiFi? Selecting a different connection
>> automatically rewrited resolv.conf based on the connection profile and
>> DHCP information from the router.
>
> When you say `WiFi', are you referring to a particular networking
> package called `WiFi'? If so, could you point to its homepage (as
> Googling `WiFi' gets all sorts of the wrong results).
>
> On my laptop or elsewhere when I have used WiFi, I have used the
> system wpa_supplicant daemon. Most GUIs probably wrap around
> wpa_supplicant as I think it is the most popular (perhaps only?)
> package for connecting to networks with modern WiFi security stuff
> like WPA. When wpa_supplicant connects to a network, it tells the init
> scripts via distro-specific hooks that the wlan0 device is ready for
> configuring. This configuration gets handed off to dhcpcd.
>
>> That would be common across the board.
>
> You're still only describing high-level conceptual ideas about your
> problem. Any solution is probably specific to what distro you're
> using, etc.
>
>> > If you're using dhcpcd, you can always edit /etc/resolv.conf.head or
>> > /etc/resolv.conf.tail
>> >
>> Interesting, .. have to check that out - thanks! I had not seen any
>> evidence they would actually be supported without an 'include' section in
>> resolv.conf, a la bash.bashrc.local.
>>
>> > If I am reading resolv.conf(5) correctly, the last search' line wins so
>> > inserting `search my-domain.com' into /etc/resolv.conf.tail would force
>> > `my-domain.com' to be your search domain.
>> >
>> It certainly would *IF* there were a way to set a persistant search domain
>> (hint, the subject <g>!).
>
> The point of resolv.conf.tail in dhcpcd's setup is to allow the
> administrator to specify persistent resolv.conf configuration
> directives. I didn't clarify this, but dhcpcd's normal behavior is to
> take the information from the DHCP server and create a resolv.conf
> file, prepend the contents of /etc/resolv.conf.head to that file, and
> then append the contents of /etc/resolv.conf.tail to that file before
> writing it to /etc/resolv.conf. Stuff in the .head and .tail is not
> overwritten by what the server sends.
>
> For example, on a machine where I run a bind daemon (just for fun,
> mostly), I have `nameserver 127.0.0.1' in resolv.conf.head so that the
> machine tries to use the local caching recursive DNS before the ISP's
> DNS servers which dhcpcd places in the middle of /etc/resolv.conf.
>
> So by a persistent search domain, I hope you mean a
> statically-configured, constant, connection-nonspecific search domain?
> ;-)
>
> --
> binki
>
> Look out for missing or extraneous apostrophes!
>
> _______________________________________________
> grlug mailing list
> grlug at grlug.org
> http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug



-- 
Roger

Roger Roelofs
Know what you value.


More information about the grlug mailing list