How to setup DNS

How do I setup DNS please? I have setup the below, and its not working… Thanks

sudo vi /etc/network/interfaces

The loopback network interface

auto lo
iface lo inet loopback

The primary network interface

auto eth0
iface eth0 inet static
address 10.x.x.x
netmask 255.255.128.0
gateway 10.x.x.x
nameservers 10.x.x.x 10.y.y.y.y
pre-up sleep 2

In which context. Please elaborate.

Well there are no details on how to do it in the documentation… So I setup the dns as above, ran a reconfigure and a reboot, and the appliance still wont lookup dns records correctly. How should I setup the appliance to query DNS? Thanks

ubuntu@graylog:~$ ping www.n1k.com
ping: unknown host www.n1k.com

The correct setting name for /etc/network/interfaces is dns-nameservers, not nameservers.

See https://help.ubuntu.com/lts/serverguide/network-configuration.html#name-resolution for details.

Hej @EricHoy

did you ask this question because you want to set them for your fresh downloaded Graylog VM and you have static network settings in your environment?

If the answer is YES, please change the setting @jochen already mentioned or set them in your /etc/resolv.conf

regards
Jan