Setting nameservers with static IP for host?

I’ve tried to set the dns-nameservers value in /etc/network/interfaces as well as in /etc/resolv.conf, but nothing seems to work. For the former, it still uses, and for the latter, it gets overwritten upon reboot.

Reason being, my internal DNS resolves things like my mail server internally, so I want to use that. Otherwise, YNH must be using a public DNS downstream and is resolving it using a my public IP (I want it to use my local IP from my local DNS).

Here is my current static IP configuration:

cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static

What is the correct way to permanently set my own nameservers for my host? Thank you.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.