dhcpd.conf, resolv.conf and the search directive

Discussion in 'Linux Networking' started by Andy Richardson, Jul 12, 2005.

  1. Hi folks quick question,

    Is there any way to automatically populate resolv.conf with more than
    one search domain.

    Currently it is given the value of the domain-name option from
    dhcpd.conf, but I need the resolver to search two domains for a hostname.




    --
    Andy Richardson

    Never criticize a man 'til you've walked a mile in his shoes.
    After that, you can say what you want..
    'cos you're a mile away and you've got his shoes.
     
    Andy Richardson, Jul 12, 2005
    #1
    1. Advertisements

  2. Andy Richardson

    Unruh Guest

    Write a script. run it whenever the system boots, or runs dhcp
     
    Unruh, Jul 12, 2005
    #2
    1. Advertisements

  3. Andy Richardson

    Bit Twister Guest

    my preference was to remove the search line to speed up all the
    external values.

    do a
    man (your_dhcp_client_daemon_here)
    to see if it indicats a file which runs after it obtains a lease.
    The script would be as simple as

    echo "search whatever you like here" > /tmp/resolv.conf
    grep -v search /etc/resolv.conf >> /tmp/resolv.conf
    /bin/cp /tmp/resolv.conf /etc/resolv.conf
     
    Bit Twister, Jul 12, 2005
    #3
  4. Andy Richardson

    Mr. Boy Guest

    dude, instead of having two domains why dont you setup 2 subdomains
    within a single domain?
    and setup a small dns server with a single zone and a couple of
    subdomains... or using /etc/hosts (if ip addresses are not dynamic)
     
    Mr. Boy, Jul 12, 2005
    #4
  5. Thanks people,
    running a script after dhcpcd has run was going to be my preferred option.
    I was just hoping there would be some neat little option in dhcpd.conf
    that would populate resolv.conf fully.
    Cheers again

    --
    Andy Richardson

    Never criticize a man 'til you've walked a mile in his shoes.
    After that, you can say what you want..
    'cos you're a mile away and you've got his shoes.
     
    Andy Richardson, Jul 13, 2005
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.