Summary: | dhcpcd sets the DNS search path, overriding the DNS domain name set from /etc/dnsdomainname by /etc/init.d/domainname | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Simon Farnsworth <simon> |
Component: | [OLD] baselayout | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | minor | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
patch to strip "search" from /etc/resolv.conf created by dhcpcd
A patch to make the domain name set by domainname the preferred domain of the machine, overriding (but not replacing) those supplied by DHCP |
Description
Simon Farnsworth
2004-04-18 17:03:07 UTC
Created attachment 39731 [details, diff]
patch to strip "search" from /etc/resolv.conf created by dhcpcd
Comment on attachment 39731 [details, diff]
patch to strip "search" from /etc/resolv.conf created by dhcpcd
This fixes the problem on my network. This will not change behavior if
/etc/dnsdomainname doesn't exist.
you can put multiple search lines in resolv.conf, you certainly dont want to go stripping all of them if you dont want dhcpcd screwing with your resolv.conf, use the -R option I'm not trying to strip any lines; the domainname script *adds* a line, which is overriden by those written by DHCPCD. I want it to add the same line, but at the other end of the file, thus overriding those written by DHCPCD, so that e-mail sent by other scripts to root@<local machine name and domain> goes to the domain that domainname sets, not to one added by DHCPCD. The idea is that *if* I set a domainname with the script, it should override those given by DHCPCD; this *leaves* the lines from DHCPCD alone. Created attachment 40709 [details, diff]
A patch to make the domain name set by domainname the preferred domain of the machine, overriding (but not replacing) those supplied by DHCP
Just to add; a fixed resolv.conf is not an option. At least two of the networks
I connect to have firewall rules that stop me using any DNS servers other than
the ones the DHCP server indicates.
The correct solution is not to do as Andrew Evans suggests, and strip search
(which breaks on one of the networks I use), but to change the awk script to
use "END" instead of "BEGIN"; I've attached a patch that does this.
This causes the machine to place itself in the domain supplied by
dnsdomainname, but to still search the domains supplied by DHCP
my comment was going by the patch submitted ... i missed the fact it wasnt submitted by the original bug reporter ;) changed behavior to append the line to the file, thanks |