# default FreeBSD dhclient doesn't support more than one search host



## kenorb (Nov 4, 2010)

```
> more /etc/resolv.conf
search core.xxx xxx dbh.xxx
nameserver 192.168.14.2

> sudo dhclient bge0
DHCPREQUEST on bge0 to 255.255.255.255 port 67
DHCPACK from 192.168.14.2
bound to 192.168.14.38 -- renewal in 300 seconds.

> more /etc/resolv.conf
search dbh.xxx
nameserver 192.168.14.2
```
Default FreeBSD dhclient limiting search option to only one host. DHCP server has more than one configured.
Any bug related to this issue?
It would be fixed, or not?


----------



## SirDice (Nov 4, 2010)

How is the DHCP server sending multiple search domains? 
Adding more domains is only possible when using domain-search (option 119).


----------



## kenorb (Nov 4, 2010)

SirDice said:
			
		

> How is the DHCP server sending multiple search domains?
> Adding more domains is only possible when using domain-search (option 119).



Yes, exactly, option 119.
How to make it working? It does work on Ubuntu.


----------



## SirDice (Nov 4, 2010)

If I look at /sbin/dhclient-script it looks like it'll only accept one domain. 

You could add more using the *prepend* or *append* options in dhclient.conf.
Or do something in /etc/dhclient-enter-hooks.

See dhclient-script(8) and dhclient.conf(5).


----------



## kenorb (Nov 4, 2010)

What about /etc/dhclient.conf, dhclient.conf(5).

I tried something like:

```
option search dbh.x.co.uk, x.co.uk, x.org.uk;
```
But the syntax is wrong;/

Is there any other dhclient in ports?


----------



## kenorb (Nov 4, 2010)

Look for: Domain Search Option Format
in http://www.ietf.org/rfc/rfc3397.txt

See also: http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg315895.html


----------



## SirDice (Nov 4, 2010)

Try something like this in dhclient.conf:


```
prepend domain-name "example.org "
```

NB Note the space after the domain!


----------



## kenorb (Nov 4, 2010)

Reported PR here:
http://www.freebsd.org/cgi/query-pr.cgi?pr=151940


----------

