the file to chanage or edit your nameservers in debian is this one:

cat /etc/resolv.conf

for example if i wanted to change my nameservers for my server to be these two:

i would send this command:
nano /etc/resolv.conf

now i would make change the contents to look something like this:


now save the file and restart your network

/etc/init.d/networking restart

if you need to change hostname, you can follow this link:

Next: Set Hostname