I have already read the very useful question about dhcpcd: How do I set up networking/WiFi/static IP address?
My situation seems to be slightly unusual:
- DHCP server on LAN is set to always give the Pi a specific IP address (based on its MAC). Let's say 192.168.0.100.
- The Pi is running
bind
, listening on 192.168.0.100:53.
I want to configure the Pi to still get its IP address via DHCP, but to force the primary DNS server to be 192.168.0.100 (itself).
I understand I should update /etc/dhcpcd.conf
with: nohook resolv.conf
Is the "correct" way, on the Pi, to set the DNS server to:
- Add the DNS configuration to
/etc/resolv.conf.tail
, OR - Add
static domain_name_servers=...
to/etc/dhcpcd.conf
?
Are there any particular advantages or disadvantages to either method?
Also, I do not want to configure the DHCP server to give out 192.168.0.100 as the DNS server.