Hostname Question

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Hostname Question

Postby Guest » Fri Apr 15, 2005 6:07 pm

On my system with Mandrake 10.1 installed, at the shell prompt it displays a prompt of user1@localhost.

I would like to change the hostname so that a name is displayed instead of localhost. I tried a few things, via the Mandrake graphic controls, but seemed to end up with a misconfigured system.

The machine has a static ip address:

% hostname -i
192.168.0.102

I have now edited the /etc/hosts file and added a line so it now looks like:
127.0.0.1 localhost
192.168.0.102 pc2

This seems to work ok, , I get a prompt of user1@pc2, except that when I now boot I get an error message to do with postfix about not being a fully qualified domain name and I need to edit /etc/postfix/main.cf.

Can anyone explain this error and what I should do (it scrolls off of the boot screen so quickly I can't easily read all the information).

Have I changed the name the right way? Is there something else I need to do?
Guest
 

RE: Hostname Question

Postby nelz » Fri Apr 15, 2005 6:26 pm

You need a domain name as well as the host name, something like
Code: Select all
192.168.0.102 pc2.my.lan pc2

This gives if a FQDN of pc2.my.lan and an alias of pc2.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8552
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby M0PHP » Fri Apr 15, 2005 7:13 pm

Yes, what he said ;)

Also, if you don't use postfix (a mail transport agent used for sending email (not required if you just use webmail or your ISP's POP/IMAP mail service)) then you can safely turn it off at startup. And all messages at startup should be sent to /var/log/messages for future reference :)
User avatar
M0PHP
LXF regular
 
Posts: 737
Joined: Wed Apr 06, 2005 7:40 am
Location: Bishop Auckland, County Durham, UK

Postby Guest » Sat Apr 16, 2005 7:04 pm

Thank-you for the replies. I didn't know I could define my own FQDN, I guess I can as it is the local 192.168... address. I had thought that all domain names were things you had to pay for.
Guest
 

Postby nelz » Sun Apr 17, 2005 7:59 am

You only have to pay to register an Internet domain name. On your own LAN, you are in charge and can do what you like.

If it makes you feel better, feel free to charge yourself for a local domain name :)
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8552
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK


Return to Help!

Who is online

Users browsing this forum: Google [Bot] and 1 guest