Configuring HOSTNAME and DOMAIN NAME

Discussion of programming on Linux, including shell scripting, perl, python, c/c++, mono, java. Whatever tickles your fancy.

Configuring HOSTNAME and DOMAIN NAME

Postby datasheet » Tue Dec 26, 2006 7:38 pm

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
datasheet
Lance Naik
 
Posts: 16
Joined: Thu Apr 27, 2006 6:51 pm

Postby kashif » Wed Dec 27, 2006 2:33 pm

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

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

Re:

Postby LinuxFreaK » Wed Dec 27, 2006 3:10 pm

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
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Postby Zaheer » Wed Dec 27, 2006 4:03 pm

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
Zaheer
Battalion Havaldaar Major
 
Posts: 284
Joined: Fri Oct 17, 2003 12:15 am
WLM: zaheermb20@hotmail.com
Yahoo Messenger: zaheermb2002@yahoo.com
Location: Karachi

Re:

Postby LinuxFreaK » Thu Dec 28, 2006 10:38 am

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
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Postby Zaheer » Thu Dec 28, 2006 11:59 am

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
Zaheer
Battalion Havaldaar Major
 
Posts: 284
Joined: Fri Oct 17, 2003 12:15 am
WLM: zaheermb20@hotmail.com
Yahoo Messenger: zaheermb2002@yahoo.com
Location: Karachi

Postby lambda » Thu Dec 28, 2006 12:27 pm

bash, not "konsole". and, it's all documented in bash's man page.
lambda
Major General
 
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Website: http://www.hungry.com/~fn/
Location: Lahore

Re:

Postby LinuxFreaK » Thu Dec 28, 2006 12:37 pm

indeed
Farrukh Ahmed
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi


Return to “%s” Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron