Archive

Posts Tagged ‘change hostname’

Set your hostname in Linux

April 1, 2013 1 comment

If you are an administrator then you know what a hostname is. If you are not an administrator then you should know that the hostname of a computer is the name which a network attached device is known. Unless you have manually changed your hostname, or set it up during installation, your hostname will most likely be “localhost.localdomain”.

Find your hostname

The most common means to find your host name is to open up a terminal window and enter the command:

hostname

If you have not set your hostname, more than likely you will see returned:

localhost.localdomain

Temporarily changing your hostname

You can temporarily change your hostname by issuing a single command as root user

hostname bharat

Now issue the command hostname which should report back:

bharat

This change will last until you reboot your machine.

Permanently changing your hostname

How you permanently change your hostname will depending upon which distribution you use.

On Ubuntu:

Edit the file /etc/hostname to remove old hostname and add new one.To make this chang take effect issue the command:

/etc/init.d/hostname.sh start

This hostname will remain intact upon reboot.

On Fedora/RHEL:

Edit the file /etc/sysconfig/network . The default contents of this file will look like below . Edit the hostname

NETWORKING=yes
 HOSTNAME=localhost.localdomain

Once you have made this change issue the following command (as the root user):

/etc/rc.d/rc.sysinit

For the change to take effect.

Categories: Linux/Unix Tags: ,
Peasland Database Blog

Where all the Action Is !!!!

Kevin Closson's Blog: Platforms, Databases and Storage

Platform, Database and Storage Topics

DBsGuru

Where all the Action Is !!!!

sqlmaria.com/

Oracle Database Product Manager with a passion for SQL, the Optimizer and performance.

Richard Foote's Oracle Blog

Focusing Specifically On Oracle Indexes, Database Administration and Some Great Music

https://dbakevlar.com/

Where all the Action Is !!!!

Pythian Technical Track

Where all the Action Is !!!!

Tales From A Lazy Fat DBA

Its all about Databases & their performance, troubleshooting & much more .... ¯\_(ツ)_/¯

Database Heartbeat

Oracle Database and Oracle Cloud Technologies

Databases Are Fun

dohdatabase.com

Upgrade your Database - NOW!

Mike Dietrich's Blog About Oracle Database Upgrades... Mostly

Oracle database internals by Riyaj

Discussions about Oracle performance tuning, RAC, Oracle internal & E-business suite.

Pavan DBA's Blog

The DBA Knowledge Store

ORACLE-BASE - Latest Articles

Where all the Action Is !!!!