Configuring HOSTNAME and DOMAIN NAME

Discussion of programming on Linux, including shell scripting, perl, python, c/c++, mono, java. Whatever tickles your fancy.
Post Reply
datasheet
Lance Naik
Posts: 16
Joined: Thu Apr 27, 2006 6:51 pm

Configuring HOSTNAME and DOMAIN NAME

Post by datasheet »

If I need to add entry for my computer name, in which file I need to make that entry?

I donot want my hostname as LOCALHOST.LOCALDOMAIN, I want it let's say Data@DataSheet.com where Data is my hostname and DataSheet.com is domain.

where I can make this entry?

Also when we run hostname or uname -n command, where it looks the information for that entry?

Thanks for any solution.

Data sheet
kashif
Naib Subedar
Posts: 305
Joined: Wed Oct 15, 2003 2:44 am
Location: Okara

Post by kashif »

Asslm 0 alikum!!

to assing the hostname user command #hostname Data.Sheet.com

to make this permanent add in /etc/sysconfig/network

Allah Hafiz
**********************************************

As-Salaatu was-Salaamu Alaika Ya Sayyidi Ya Rasool ALLAH

**********************************************
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear datasheet,
Salam,

Run following code in command line and you will get an idea :)

Code: Select all

PS1="\s\v \[\e[31m\]User \[\e[34m\]\u \[\e[31m\]on host \[\e[34m\]\h\[\e[31m\] in dir \[\e[34m\]\w\n\d \t> \[\e[37m\] "
Best Regards.
Farrukh Ahmed
Zaheer
Battalion Havaldaar Major
Posts: 286
Joined: Fri Oct 17, 2003 12:15 am
Location: Karachi
Contact:

Post by Zaheer »

From where you got this code cool one.liked It
Good Judgement comes from Experience and Experience comes from bad Judgement!!
The more I know, the more I realize I don't know!?
The easiest way to find out is to try Out!!!

Registered Linux user #333501
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear Zaheer,
Salam,

Use this one you will like this one also.

PS1="\u (\[\e[1;31m\]\h\[\e[m\]:\[\e[33m\]\l\[\e[m\]:\[\e[32m\]\j\[\e[m\])\[\e[1m\]\w\[\e[m\] \$"

Best Regards.
Farrukh Ahmed
Zaheer
Battalion Havaldaar Major
Posts: 286
Joined: Fri Oct 17, 2003 12:15 am
Location: Karachi
Contact:

Post by Zaheer »

Wowww !

Can u give me a link for these types Of "bash" not Konsole trickies.

Now its Ok
Last edited by Zaheer on Thu Dec 28, 2006 12:51 pm, edited 2 times in total.
Good Judgement comes from Experience and Experience comes from bad Judgement!!
The more I know, the more I realize I don't know!?
The easiest way to find out is to try Out!!!

Registered Linux user #333501
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

bash, not "konsole". and, it's all documented in bash's man page.
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

indeed
Farrukh Ahmed
Post Reply