how to properly edit hosts, hostname and resolf.conf? [migrated]
- by Firewall
i,v been searching the internet for a real noop tutorial on the subject but could not found any direct info. on how to edit these files the proper way.
i,v got a debian internet server that i use to host some personal domains and runs squid and rTorrent. the server is up and running with no problems but i am confused about a few things.
lets say that i named my server (foo), my domain is (example.com) and my public IP is 95.211.133.200 now:
should /etc/hostname contains:
tango.example.com
or
tango <----- just the server name
should /etc/hosts contains:
127.0.0.1 localhost.localdomain localhost
95.211.133.200 foo.example.com foo
should /etc/resolf.conf contains (along with the nameservers) both:
domain example.com
search example.com
or just the first one.
are there any other files that i should edit in order to make things right?
last thing, the command:
domainname
returns: (none)
i believe it should return (example.com). what should i do to correct that?