LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-23-2004, 12:37 AM   #1
lawkh
LQ Newbie
 
Registered: May 2003
Posts: 19

Rep: Reputation: 0
setting up my hostname


1). How to setup a host name? as I know a host name can be anything u make up, but what about the domain name, can I pick any domain name i want as well?
2). Do I have to associate my ip with the hostname under the HOST tab in network config? If I do, what should I put in the alias field?
3). if all of the above has been done correctly, would there be any problem accessing to my computer from a remote host by ssh? or I need to config something else?

I know these may sound stupid, but I really need someone to help me on this.

I am using redhat 7.2, thx
 
Old 01-23-2004, 01:35 AM   #2
born4linux
Senior Member
 
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
set the hostname in /etc/hosts. if u are running a local DNS server, u can set up any domain name you want. that way, u can do 'host based' resolution within your network.

if you only do the hostname assignment via /etc/hosts, remote machines won't know it. u need to set the hostname with the corresponding IP address to other machine's hosts file.
 
Old 01-23-2004, 02:05 AM   #3
.nyteshyft
Member
 
Registered: Jan 2004
Location: Melbourne, Australia
Distribution: Mandrake 9.1
Posts: 48

Rep: Reputation: 15
Here is an example: say my hostname is "nyteshyft", and the domain name that i am associated with is called "nyteshyft.org", and that my IP address is "128.1.1.2".

Code:
edit /etc/sysconfig/network, modify the following entries:
hostname = "nyteshyft"
domainname = "nyteshyft.org"
Restart your machine. Test your hostname and domainname:
Code:
# hostname
nyteshyft

# hostname --fqdn
nyteshyft.nyteshyft.org


# dnsdomainname
nyteshyft.org
Keep all your most used host names and IP addresses in /etc/hosts
Code:
127.0.0.1          localhost.localdomain.com          localhost
128.1.1.2          nyteshyft.nyteshyft.org              nyteshyft
Configure the DNS using /etc/resolv.conf
Code:
search nyteshyft.org
nameserver 0.0.0.0
You can configure the order of the nameservers too with /etc/nsswitch.conf (everything else is unchanged)
Code:
hosts:               dns files
i hope thats all right, worked for me, my friend told me some of it though, pretty easy once you know it
 
Old 01-23-2004, 04:22 PM   #4
lawkh
LQ Newbie
 
Registered: May 2003
Posts: 19

Original Poster
Rep: Reputation: 0
everything i clear, except the part that to configure etc/resolv.conf and etc/nsswitch.conf, what are they doing? what would be the ip of the nameserver?
In etc/nsswitch.conf, I just type in "hosts: dns files", or i have to fill in other information, can u make a concrete example?
also what does the localhost thing do, i read some web page and it says that local host is for some special use.
 
  


Reply



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
Setting Hostname abhijeetudas Linux - Networking 1 06-04-2005 07:10 AM
setting up hostname in RH9 wiredX Linux - General 9 07-15-2003 10:46 AM
setting hostname akamol Linux - General 2 07-03-2003 03:48 AM
setting hostname skunk1 Solaris / OpenSolaris 3 04-02-2003 01:00 AM
setting up a hostname sakeeb Linux - Networking 3 04-28-2002 04:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:06 PM.

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