Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've setup a LAMP server on Ubuntu 10.04 (lucid) and have also installed Virtualmin. This is my first attempt at setting up a server of any sort.

I set up one virtual host using Virtualmin and so far so good. Some odd things are happening though, such as when I type in my primary domain into a browser, I see the contents of the virtual server instead of what should be in the default directory.

I'm going to use 123.345.789 and instead of my actual ip and domain name's if thats ok.

I checked my hostname by using

hostname -f

and got


as my response

The contents of my /etc/hosts file is (ip's and domain changed to something generic for this post):     localhost localhost.localdomain
123.456.789     production1

shouldn't my FQD be How can I go about changing this?, a simple step by step instruction would be great! thanks in advance.

share|improve this question
via blueben, my hosts file has a mistake, IP's shouldn't be listed on multiple rows. – Demwunz Jan 12 '11 at 9:23
up vote 1 down vote accepted

The /etc/hosts file contains some last ditch effort at name resolution, but isn't the full story with what you're trying to do. Do the following and you should be good to go:

  1. Edit /etc/hostname such that it contains only ''
  2. Run hostname -F /etc/hostname

The hostname file contains your fqdn for system use, and the hostname command re-reads that file for the system. At this point you can restart your services and everything should work fine, worst case a reboot might be necessary.

share|improve this answer

Your hosts file has a mistake; You shouldn't list an IP on multiple rows.     localhost localhost.localdomain
123.456.789 production1
share|improve this answer

Your Answer


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.