Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-19-2001, 03:23 AM
|
#1
|
LQ Newbie
Registered: Sep 2001
Posts: 4
Rep:
|
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!
|
|
|
09-20-2001, 12:50 AM
|
#2
|
Member
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986
Rep:
|
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 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): . 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.
|
|
|
09-20-2001, 03:06 AM
|
#3
|
LQ Newbie
Registered: Sep 2001
Posts: 4
Original Poster
Rep:
|
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!
|
|
|
09-20-2001, 09:34 PM
|
#4
|
Member
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986
Rep:
|
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.
|
|
|
09-20-2001, 10:50 PM
|
#5
|
LQ Newbie
Registered: Sep 2001
Posts: 4
Original Poster
Rep:
|
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!
|
|
|
09-21-2001, 12:02 AM
|
#6
|
Member
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986
Rep:
|
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.
-----------------------.
|
|
|
09-21-2001, 12:17 AM
|
#7
|
LQ Newbie
Registered: Sep 2001
Posts: 4
Original Poster
Rep:
|
then....
Dear Sir,
Then how should I do right now?thanks!
|
|
|
All times are GMT -5. The time now is 01:09 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|