LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-19-2001, 03:23 AM   #1
hpchong7
LQ Newbie
 
Registered: Sep 2001
Posts: 4

Rep: Reputation: 0
domain name


Dear all,

1.)Do you know what command should I issue such that I can know what current run level I am in?
2.)Do you know where to set the domain name?(now it is root@localhost.localdomain , I want to change it to , say, root@abc.com)

Thank you very much!
 
Old 09-20-2001, 12:50 AM   #2
DMR
Member
 
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986

Rep: Reputation: 30
Re: domain name

Quote:
1.)Do you know what command should I issue such that I can know what current run level I am in?
Surpisingly enough, the command is "runlevel". It will return two values, the first being the previous runlevel; the second being the current runlevel. If you haven't changed runlevels since you booted into the default runlevel, the first ("previous") value will be "N" for "None". The default runlevel is that specified in the
Code:
id:n:initdefault:
line of /etc/inittab, where "n" is a number specifying the runlevel. If, after booting, you haven't changed runlevels by issuing the "init <runlevel_number>" command, your runlevel will always be the default specified in /ect/inittab.
Quote:
2.)Do you know where to set the domain name?(now it is "root@localhost.localdomain" , I want to change it to , say,"root@abc.com")
The "hostname" command can be used to check and/or change both the host and domain names. If you just issue the "hostname" command, that will return your current host+domain name. Given your example, the output from the hostname command should be "localhost.localdomain" (the "root@" is not part of your host/domain name, you just get that as a function of how your command prompt is set up). If you want to change that , issue the hostname command followed by your new name (again using your example):
Code:
hostname abc.com
. You might have to restart for this to take effect.

Also- be aware that there is a "domainname" command, but it applies only to an NIS domain name, and isn't necessarily the same as the hostname/domain that you're asking about.

Last edited by DMR; 09-20-2001 at 01:05 AM.
 
Old 09-20-2001, 03:06 AM   #3
hpchong7
LQ Newbie
 
Registered: Sep 2001
Posts: 4

Original Poster
Rep: Reputation: 0
reply

I've tried hostname abc.com,however,

1)I've to set it again each time I reboot
2)As told by you it just set the domain name.How can I set the host name then?(e.g , I want to set the hostname to hpchong7).

Thank you very much!
 
Old 09-20-2001, 09:34 PM   #4
DMR
Member
 
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986

Rep: Reputation: 30
Sorry- it seems that setting the hostname with the hostname command isn't persistent.

The hostname is stored in two files, /etc/hosts and /etc/sysconfig/network. If you change your hostname, make sure you change it in both files. You can also set your hostname using the graphical configuration tools linuxconf and netconf. In either one, click on the "Basic Host Information" heading.
 
Old 09-20-2001, 10:50 PM   #5
hpchong7
LQ Newbie
 
Registered: Sep 2001
Posts: 4

Original Poster
Rep: Reputation: 0
how?

Dear sir,

May you teach me how to change as I get my IP from DHCP.It's not good to hard code the IP in /etc/hosts.Thank you!
 
Old 09-21-2001, 12:02 AM   #6
DMR
Member
 
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986

Rep: Reputation: 30
Re: how?

Quote:
Originally posted by hpchong7
Dear sir,

May you teach me how to change as I get my IP from DHCP.It's not good to hard code the IP in /etc/hosts.Thank you!
Sorry, but no, I can't. I assumed by the nature of your troll that you were using static, not dynamic.

-----------------------.
 
Old 09-21-2001, 12:17 AM   #7
hpchong7
LQ Newbie
 
Registered: Sep 2001
Posts: 4

Original Poster
Rep: Reputation: 0
then....

Dear Sir,

Then how should I do right now?thanks!
 
  


Reply


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
what would make ever virtual domain name resolve to one domain name on my system kuplo Linux - Newbie 1 11-14-2005 07:57 PM
linux domain versus windows domain JamShah Linux - Networking 5 10-31-2005 07:52 PM
Cant get entry in bind to work with domain.com instead of www.domain.com pxes351 Linux - Networking 12 05-09-2005 07:20 AM
Sendmail sending as host.domain.com, i want it to be from just domain.com. PlatinumRik Linux - Software 5 10-07-2004 05:32 PM
Joining a machine from another domain to my linux samba domain acummins Linux - Networking 0 09-13-2003 08:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:09 AM.

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