Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-05-2009, 02:39 PM   #1
Registered: Mar 2009
Posts: 222

Rep: Reputation: 30
Assign Static Hostname in Ubuntu Server

How do I assign a static hostname in Ubuntu server?

I need this one static so when I reboot the server it doesnt change to default locahost.

Please advise.

Old 08-05-2009, 02:46 PM   #2
Senior Member
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,274

Rep: Reputation: 148Reputation: 148
edit your /etc/hosts and add
ipaddress hostname

edit the /etc/sysconfig/network
Old 08-05-2009, 02:46 PM   #3
Senior Member
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
On Debian you can set it in /etc/hostname . Should be the same in Ubuntu.
Old 08-05-2009, 04:01 PM   #4
Registered: Mar 2009
Posts: 222

Original Poster
Rep: Reputation: 30
Originally Posted by makuyl View Post
On Debian you can set it in /etc/hostname . Should be the same in Ubuntu.
/etc/hostname is the right path for ubuntu server.

You resolved my issue.

Thank you mate!



hostname, server, static, ubuntu

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I assign a static IP address to a DHCP server? Cyberman Linux - Networking 6 01-29-2010 03:47 PM
How to assign a static IP freak_vss Linux - Networking 4 08-26-2008 08:03 PM
Howto Assign Multiple Static Public IP Addresses under SBC's PPPoE Static Ip system o trekgraham Linux - Networking 8 04-17-2007 10:51 AM
assign static ip allelopath Linux - Software 1 04-27-2005 07:04 PM
assign static IP to the server ashley75 Linux - General 2 03-10-2005 03:47 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration