I run Ubuntu 14.04 instances on AWS EC2 in a VPC. These use the nameserver provided by our VPC. Each DNS lookup by a process is sent to the VPC nameserver. Our processes do many lookups, and some fail, resulting in blocked processes.
I wish to fix this by installing a local caching DNS resolver on every machine.
This resolver will listen on
127.0.0.1:53, serving local processes.
The resolver will be listed in
i.e. I'll have
nameserver 127.0.0.1 instead of the VPC nameserver provided dynamically via DHCP.
There are lots of alternatives programs for this:
But there seem to be many ways to manually manage
e.g. marking the file as read-only, or editing
/etc/network/interfaces, or editing
Which is recommended?
I have one more requirement: the local resolver will forward lookups to the VPC nameserver, our trusted authority for DNS info. However, the programs I listed do not seem to behave this way. Instead, they forward their lookups to preconfigured root nameservers.
Theoretically, I could make this work by customising
resolvconf, or something like that.
I would add a hook which takes the DHCP-provided nameserver IP, injects it into my local DNS resolver's config,
then restart the local DNS resolver daemon.
But this is pretty hairy, and I want to avoid doing that.
(The default scripts in Ubuntu 14.04 seem to have some inbuilt knowledge of
and possibly do what I want, but it's very unclear.)
Which is the "blessed" way to run a local caching DNS resolver on Ubuntu 14.04? In particular, how do I make the local resolver forward to the default DHCP nameserver?