Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm updating my mail servers' rDNS and I think I have it all figured out except for one thing.

When I installed my OS (Debian Etch), the installer asked me to enter the "domain name".

  1. Is the "domain name" updated by using the hostname command?
  2. If so, which config file(s) are updated when using the hostname command?
  3. If not, how do I change my servers' domain name?

My current /etc/hosts:

127.0.0.1       localhost
67.228.178.164  mrspock.example-old.com      mrspock

My current /etc/hostname:

mrspock

$ hostname -f

mrspock.example-old.com

I need to update hostname -f to be mrspock.example-new.com.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

Answering my own question.

It appears (according to this and this) that you only need to update /etc/hosts to change the domain name specified during install on a Debian system:

127.0.0.1       localhost
67.228.178.164  mrspock.example-new.com      mrspock

That should do it. Please correct me if I'm wrong, but I can't find any other info on changing the domain name. Also, hostname -f produces "mrspock.example-new.com" after updating /etc/hosts, as expected.

share|improve this answer

Is the "domain name" updated by using the hostname command?

If so, which config file(s) are updated when using the hostname command?

No! hostname Command update /etc/hostname

how do I change my servers' domain name?

you can change your domainname by:

# domainname <NEWNAME>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.