Maintained by: NLnet Labs

DHCP question

Tom Hendrikx
Wed Jul 6 18:39:15 CEST 2016


On 06-07-16 13:57, Bryan C. Everly via Unbound-users wrote:
> Hello,
> 
> I'm running OpenBSD-current with the provided unbound and dhcpd and
> I'm trying to accomplish something that I would think should be pretty
> straightforward.  When my network clients get an IP address from
> dhcpd, I'd like to be able to resolve their hostnames via my local
> unbound DNS server.
> 
> Example:
> 
> 1.  A laptop with the name foo.bar.com asks dhcpd for an IP address
> 2.  The laptop is assigned 192.168.1.50
> 3.  On a second machine on the network, I'd like to ping foo.bar.com
> and get 192.168.1.50 resolved
> 
> Is there a configuration option for this or some nudge you can give a
> n00b to help me figure this out?  My Google-Fu has failed me this time
> around.
> 
> Thanks,
> Bryan
> 

I created a similar setup, using unbound as my resolver, and dnsmasq for
dhcp: dnsmasq is both a dns cache and a dhcp server, and can/will serve
the dns hostnames for the dhcp clients.

You run dnsmasq on port 10053 localhost, and setup unbound to use that
for your dhcp assigned domain space.

unbound.conf:

server:
    do-not-query-localhost: no
    private-domain: lan.example.net
    domain-insecure: lan.example.net

    local-zone: "168.192.in-addr.arpa." nodefault

    stub-zone:
        name: "lan.example.net"
        stub-addr: 127.0.0.1 at 10053

    stub-zone:
        name: "168.192.in-addr.arpa."
        stub-addr: 127.0.0.1 at 10053


Kind regards,
	Tom

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://unbound.nlnetlabs.nl/pipermail/unbound-users/attachments/20160706/aef8b6d9/attachment-0001.sig>