Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 94027 - dhcpcd clobbers domain search entries in /etc/resolv.conf
Summary: dhcpcd clobbers domain search entries in /etc/resolv.conf
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Other
: High normal (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-25 19:34 UTC by Andrey Kislyuk (RETIRED)
Modified: 2005-07-19 14:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
dhcpcd patch to cache and restore search domains when updating resolv.conf (dhcpcd-keep-search-domains.patch,2.13 KB, patch)
2005-05-26 11:17 UTC, Andrey Kislyuk (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Kislyuk (RETIRED) gentoo-dev 2005-05-25 19:34:51 UTC
I frequently switch network connections on my laptop. When I run dhcpcd, I want the dns servers in /etc/resolv.conf to be updated, but I do not want my list of search domains to be overwritten with just the domain the local DHCP server supplies. I can find no way to configure dhcpcd or scripts that call it to write domain search entries back to resolv.conf other than to edit them by hand. If there is no way to configure the system to do this, there should be.
Comment 1 SpanKY gentoo-dev 2005-05-26 05:54:15 UTC
if you're using baselayout-1.9.x, read `man dhcpcd`

if you're using baselayout-1.11.x, read /etc/conf.d/net.example
Comment 2 Andrey Kislyuk (RETIRED) gentoo-dev 2005-05-26 06:22:01 UTC
I'm using baselayout-1.9. The only thing in man dhcpcd(8) that I find relevant
is the -R option. This is _not what I am asking for_. The -R option prevents
dhcpcd from updating either the search domains or the DNS servers. I want
granularity in this - I want to update my DNS servers (so that they're local to
my network) but not my search domains (so that all of my home domains are still
searched).

If I'm missing some other option, please let me know.
Comment 3 SpanKY gentoo-dev 2005-05-26 07:55:10 UTC
there is no configure option for that level of granularity
Comment 4 Andrey Kislyuk (RETIRED) gentoo-dev 2005-05-26 11:17:50 UTC
Created attachment 59891 [details, diff]
dhcpcd patch to cache and restore search domains when updating resolv.conf

Proposed patch to dhcpcd.

This is very preliminary. I couldn't find a good unused letter for the option
so I chose 'Z'. Also I'm not sure if the save block is in the correct location
in dhcpconfig.c.

This is my first bugzilla patch ever, so let me know if anything is horribly
wrong.
Comment 5 Andrey Kislyuk (RETIRED) gentoo-dev 2005-05-30 12:54:19 UTC
'e' is probably the best unused dhcpcd option letter for this (k, s, r are taken)
Comment 6 Roy Marples (RETIRED) gentoo-dev 2005-06-02 07:18:45 UTC
Your patch is rejected, but functionality will be provided to achieve what you
require.

baselayout-1.12.0-alpha3 will allow the
dns_search_domains_{eth0|essid|mac|apmac}="foo bar" variable in /etc/conf.d/net
to work in conjuction with dhcpcd-1.3.22_p4-r10 - neither of which are in
portage at this time.

I'll close this bug as FIXED when both are available in portage.
Comment 7 SpanKY gentoo-dev 2005-06-02 09:05:28 UTC
might want to check /etc/conf.d/domainname and make sure you're not duplicating
functionality with the OVERRIDE variable
Comment 8 Roy Marples (RETIRED) gentoo-dev 2005-06-02 09:36:41 UTC
/etc/conf.d/domainname just sets the dns and nis domain names.

We're talking about search domains.
For example in /etc/resolv.conf

domain foo
nameserver 192.168.0.1
search bar spanky

This sets the hosts dns domain to foo and if any non FQDN requests cannot be
matched in the foo domain then it will search bar and then spanky domains.

Current dhcpcd in portage doesn't set the domain - instead it sets the search
domains. This is bad behaviour really.

I currently have a dhcpcd patch which I'm testing that sets up decent
/etc/{resolv,ntp,yp}.conf files based on what dhclient and udhcpc currently do.

So I don't think I'm reproducing any functionality here.
Comment 9 Roy Marples (RETIRED) gentoo-dev 2005-07-19 14:03:36 UTC
Fixed in baselayout-1.12.0_pre1-r1