# DHCP client DNS -> DHCP server DNS



## Radium (Jul 27, 2014)

Hi!

I'm using dhclient for WAN and isc-dhcpd43 for LAN. How do I supply my LAN clients with the DNS addresses supplied by my ISP?

Thanks in advance,

Radium, Sweden


----------



## SirDice (Jul 28, 2014)

Your LAN DHCP server should provide them. But your /etc/resolv.conf may be overwritten by dhclient(8). Have a look in this thread to see what you can do to prevent this: viewtopic.php?f=3&t=15283


----------



## Radium (Jul 29, 2014)

Aha! So dhclient(8) writes to /etc/resolv.conf when it obtains DNS server addresses? Does ISC dhcpd read from /etc/resolv.conf by default if I don't define any in name servers in dhcpd.conf?


----------



## SirDice (Jul 29, 2014)

Radium said:
			
		

> So dhclient(8) writes to /etc/resolv.conf when it obtains DNS server addresses?


Yes.


> Does ISC dhcpd read from /etc/resolv.conf by default if I don't define any in name servers in dhcpd.conf?


No, it simply won't provide DNS server addresses.


----------



## Radium (Jul 29, 2014)

How do I make dhcpd obtain name servers from /etc/resolv.conf?


----------



## Radium (Jul 30, 2014)

SirDice said:
			
		

> Radium said:
> 
> 
> 
> ...



It seems that nobody understands what I'm trying to do. I want dhclient to hand the name servers to dhcpd.conf and I've also set up two VLANs on the WAN port and dhclient requests information that I want to relay to two of my LAN clients via dhcpd. Looking into /sbin/dhclient-script doesn't make me any wiser on how to do this. The information that I want to relay is inside the .leases files for the two VLANs. I've also considered using dhcrelay but that one doesn't seem to be able to help me in any way as it will relay ALL requests. I still want my LAN clients to remain in my LAN but get some extra info only available after dhclient has sent requests to the two VLANs. The two VLANs in question are VoIP and IPTV, with VLAN ID 855 and 845.

Does anyone know the cleanest way to do this? :q


----------



## SirDice (Jul 30, 2014)

You will have to script something yourself. Something that dynamically changes dhcpd.conf. There's no configuration setting that does this 'automagically'.


----------



## kpa (Jul 30, 2014)

Some replacement DNS forwarders that also implement a DHCP server have an option to do exactly that, for example dns/dnsmasq. Unfortunately the ISC DHCPd was never designed to be used in such way, there's an implicit assumption that the DNS forwarders provided by the DHCP server would be at static well known addresses that do not change often. The DNS forwarder addresses provided by your ISP's DHCP service are often not very static and can change suddenly when the WAN interface gets a new address from a completely new subnet.


----------



## SirDice (Jul 30, 2014)

I'd set up a caching only DNS server on the gateway and have DHCPd supply that address. The caching DNS server will take care of the resolving upstream.


----------

