[Unbound-users] Replacing /etc/hosts aliases with local-data: directive

Steve Jenkins stevejenkins at gmail.com
Thu Mar 24 20:12:41 UTC 2011

We've recently set up Unbound as a local recursive resolver, which is
working great. We've got a dozen or so servers on our rack across
three different domains, so we've been using our /etc/hosts file to
set up aliases for them. For example:

123.456.78.910          jim.domain1.com jim
234.567.89.012          doug.domain2.com doug
345.678.90.123          sally.domain3.com sally

This way, we can easily connect to local systems by simply doing "ssh
jim" or 'ftp sally."

The problem is that when we change a host's IP address, or add a new
host to the rack, we have to manually update the hosts file on EVERY
box, so I've been fiddling with unbound to try and make it so we only
have to update it in one place, and then it will act as the local
resolver for those IPs.

I can make it function with the following:

local-zone: "local." static
local-data: "jim.local.     IN A 123.456.78.910"
local-data: "doug.local.   IN A 234.567.89.012"
local-data: "sally.local.    IN A 345.678.90.123"

But it's not exactly what we want... we have to do "ping jim.local" or
"ssh doug.local" to connect.

Is there a way to configure unbound.conf so that it will work without
the ".local" ?



More information about the Unbound-users mailing list