[arch-general] /etc/resolv.conf and /etc/resolc.conf.tail
Hi, this is my first message to arch-general. I have been helping a user on the forums who needs multiple search domains in his /etc/resolv.conf file. His original question was this: "Our DHCP isolates clients to a separate subnet than the servers. As such, unless you fully qualify the server name, you can't find the server. A work around is to put the IP in the hosts file, but there are just too many servers to do that with. Another option is to add the search domain(s) in the to the end of the search line in resolv.conf, however that file is re-written by dhcpcd, so changes are quickly lost. Is there a way to add on search domains to what DHCP hands your system?" I have done some research and found that the BSDs have a particularly nice solution to this; /etc/resolv.conf.tail Basically, it does this: #!/bin/bash if [ -f /etc/resolv.conf.tail ]; then cat /etc/resolv.conf.tail >> /etc/resolv.conf fi I am still new to arch, and I don't know who exactly deals with this portion of the distro. Is this something that can be made standard? It seems like a very simple fix. Very useful too. Here is the forum posting: http://bbs.archlinux.org/viewtopic.php?pid=388345#p388345 --timetrap
Here is an experimental patch for /sbin/dhclient-script, this will add the /etc/resolv.conf.tail concatenation to dhclient. Would somebody else try this out? back up your /sbin/dhclient-script before running this, or course. On Tue, Jul 1, 2008 at 11:05 AM, timetrap <timetrap@gmail.com> wrote:
Hi, this is my first message to arch-general.
I have been helping a user on the forums who needs multiple search domains in his /etc/resolv.conf file.
His original question was this:
"Our DHCP isolates clients to a separate subnet than the servers. As such, unless you fully qualify the server name, you can't find the server. A work around is to put the IP in the hosts file, but there are just too many servers to do that with. Another option is to add the search domain(s) in the to the end of the search line in resolv.conf, however that file is re-written by dhcpcd, so changes are quickly lost.
Is there a way to add on search domains to what DHCP hands your system?"
I have done some research and found that the BSDs have a particularly nice solution to this; /etc/resolv.conf.tail
Basically, it does this:
#!/bin/bash
if [ -f /etc/resolv.conf.tail ]; then cat /etc/resolv.conf.tail >> /etc/resolv.conf fi
I am still new to arch, and I don't know who exactly deals with this portion of the distro. Is this something that can be made standard? It seems like a very simple fix. Very useful too.
Here is the forum posting: http://bbs.archlinux.org/viewtopic.php?pid=388345#p388345
--timetrap
Alright, I guess my formatting was a little off; here is a new patch, this one works. :-) Any comments? On Tue, Jul 1, 2008 at 11:32 AM, timetrap <timetrap@gmail.com> wrote:
Here is an experimental patch for /sbin/dhclient-script, this will add the /etc/resolv.conf.tail concatenation to dhclient.
Would somebody else try this out?
back up your /sbin/dhclient-script before running this, or course.
On Tue, Jul 1, 2008 at 11:05 AM, timetrap <timetrap@gmail.com> wrote:
Hi, this is my first message to arch-general.
I have been helping a user on the forums who needs multiple search domains in his /etc/resolv.conf file.
His original question was this:
"Our DHCP isolates clients to a separate subnet than the servers. As such, unless you fully qualify the server name, you can't find the server. A work around is to put the IP in the hosts file, but there are just too many servers to do that with. Another option is to add the search domain(s) in the to the end of the search line in resolv.conf, however that file is re-written by dhcpcd, so changes are quickly lost.
Is there a way to add on search domains to what DHCP hands your system?"
I have done some research and found that the BSDs have a particularly nice solution to this; /etc/resolv.conf.tail
Basically, it does this:
#!/bin/bash
if [ -f /etc/resolv.conf.tail ]; then cat /etc/resolv.conf.tail >> /etc/resolv.conf fi
I am still new to arch, and I don't know who exactly deals with this portion of the distro. Is this something that can be made standard? It seems like a very simple fix. Very useful too.
Here is the forum posting: http://bbs.archlinux.org/viewtopic.php?pid=388345#p388345
--timetrap
On Tue, Jul 1, 2008 at 2:48 PM, timetrap <timetrap@gmail.com> wrote:
Alright, I guess my formatting was a little off; here is a new patch, this one works. :-)
Any comments? I'm in favor of this. I don't see how it could hurt, and it definitely seems more useful than telling dhcp to use a static resolv.conf
timetrap wrote:
Hi, this is my first message to arch-general.
I have been helping a user on the forums who needs multiple search domains in his /etc/resolv.conf file.
His original question was this:
"Our DHCP isolates clients to a separate subnet than the servers. As such, unless you fully qualify the server name, you can't find the server. A work around is to put the IP in the hosts file, but there are just too many servers to do that with. Another option is to add the search domain(s) in the to the end of the search line in resolv.conf, however that file is re-written by dhcpcd, so changes are quickly lost.
Is there a way to add on search domains to what DHCP hands your system?"
I have done some research and found that the BSDs have a particularly nice solution to this; /etc/resolv.conf.tail
Basically, it does this:
#!/bin/bash
if [ -f /etc/resolv.conf.tail ]; then cat /etc/resolv.conf.tail >> /etc/resolv.conf fi
I am still new to arch, and I don't know who exactly deals with this portion of the distro. Is this something that can be made standard? It seems like a very simple fix. Very useful too.
Here is the forum posting: http://bbs.archlinux.org/viewtopic.php?pid=388345#p388345
--timetrap
Something like that is totally unecessairy. That's why we have /etc/conf.d/dhcpcd. Also see man dhcpcd. Glenn
dhcpcd is fine. But this is a patch for dhclient. Which is a totally different dhcp client. When I installed wicd, dhclient was a dependency, if you want to use wicd, you need to use dhclient. If you want to have multiple search domains with dhclient (through wicd), you need to edit your /etc/resolv.conf and append those search domains. Rather than edit by hand, or run an external script. Why not just patch the dhclient-script? So yes, something like this SHOULD be unecessairy. But it isn't. On Thu, Jul 3, 2008 at 1:34 PM, RedShift <redshift@pandora.be> wrote:
timetrap wrote:
Hi, this is my first message to arch-general.
I have been helping a user on the forums who needs multiple search domains in his /etc/resolv.conf file.
His original question was this:
"Our DHCP isolates clients to a separate subnet than the servers. As such, unless you fully qualify the server name, you can't find the server. A work around is to put the IP in the hosts file, but there are just too many servers to do that with. Another option is to add the search domain(s) in the to the end of the search line in resolv.conf, however that file is re-written by dhcpcd, so changes are quickly lost.
Is there a way to add on search domains to what DHCP hands your system?"
I have done some research and found that the BSDs have a particularly nice solution to this; /etc/resolv.conf.tail
Basically, it does this:
#!/bin/bash
if [ -f /etc/resolv.conf.tail ]; then cat /etc/resolv.conf.tail >> /etc/resolv.conf fi
I am still new to arch, and I don't know who exactly deals with this portion of the distro. Is this something that can be made standard? It seems like a very simple fix. Very useful too.
Here is the forum posting: http://bbs.archlinux.org/viewtopic.php?pid=388345#p388345
--timetrap
Something like that is totally unecessairy. That's why we have /etc/conf.d/dhcpcd. Also see man dhcpcd.
Glenn
timetrap wrote:
dhcpcd is fine. But this is a patch for dhclient. Which is a totally different dhcp client.
When I installed wicd, dhclient was a dependency, if you want to use wicd, you need to use dhclient. If you want to have multiple search domains with dhclient (through wicd), you need to edit your /etc/resolv.conf and append those search domains.
Rather than edit by hand, or run an external script. Why not just patch the dhclient-script?
So yes, something like this SHOULD be unecessairy. But it isn't.
Oops. Didn't notice it was for dhclient. Anyways, dhclient-script is provided by upstream, so either apply your patch everytime the package is upgraded or build your own dhclient package. Glenn
I'll give it a shot. Thanks. On Thu, Jul 3, 2008 at 2:08 PM, RedShift <redshift@pandora.be> wrote:
timetrap wrote:
dhcpcd is fine. But this is a patch for dhclient. Which is a totally different dhcp client.
When I installed wicd, dhclient was a dependency, if you want to use wicd, you need to use dhclient. If you want to have multiple search domains with dhclient (through wicd), you need to edit your /etc/resolv.conf and append those search domains.
Rather than edit by hand, or run an external script. Why not just patch the dhclient-script?
So yes, something like this SHOULD be unecessairy. But it isn't.
Oops. Didn't notice it was for dhclient. Anyways, dhclient-script is provided by upstream, so either apply your patch everytime the package is upgraded or build your own dhclient package.
Glenn
On Thu, 2008-07-03 at 13:58 -0400, timetrap wrote:
dhcpcd is fine. But this is a patch for dhclient. Which is a totally different dhcp client.
When I installed wicd, dhclient was a dependency, if you want to use wicd, you need to use dhclient. If you want to have multiple search domains with dhclient (through wicd), you need to edit your /etc/resolv.conf and append those search domains.
Rather than edit by hand, or run an external script. Why not just patch the dhclient-script?
So yes, something like this SHOULD be unecessairy. But it isn't.
man dhclient.conf and you'll find out about supersede and prepend options. No need to add hacks for /etc/resolv.conf.append files. This is what I have on my OpenBSD machine for dhclient.conf: supersede domain-name "groot.local"; supersede domain-name-servers 192.168.1.2; which replaces dhcp variables with locales from my config. Replacing these with prepend or append will add them to the dhcp-provided options.
participants (4)
-
Daenyth Blank
-
Jan de Groot
-
RedShift
-
timetrap