Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
domain name and host name
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
hvedam
n00b
n00b


Joined: 17 Sep 2005
Posts: 38

PostPosted: Sun Sep 18, 2005 11:18 pm    Post subject: domain name and host name Reply with quote

host name is recognizing what's your name on the network right...i'm pretty sure of that. I don't understand what's the purpose of domainname.. can someone explain that to me? it will be great, i'm just really confused at this part of manual is it neccessary to have domainname?
_________________
harushimo
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10459
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Sep 19, 2005 3:13 am    Post subject: Reply with quote

You're right about the definition of "host name": a unique name for your computer so that other computers can refer to it by name. You can just use the default from the handbook for the domain name. Not too simplistically, the domain name gives your local area network as a whole a unique name. Its value only becomes important when you're trying to let computers outside your organization (house, dorm room, etc.) have access to the computers inside your organization. If you need information beyond this, please reply.

- John
Back to top
View user's profile Send private message
hvedam
n00b
n00b


Joined: 17 Sep 2005
Posts: 38

PostPosted: Mon Sep 19, 2005 3:15 am    Post subject: Reply with quote

next the step, the host file is indicating what other computers are the network right? by there ipaddress?
_________________
harushimo
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10459
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Sep 19, 2005 3:25 am    Post subject: Reply with quote

That's right. I believe the file you're referring to is /etc/hosts. If you have 3 computers on your LAN, you can out the IP addresses of the other two in your /etc/hosts. Here's one of my /etc/hosts files for reference:
Code:
127.0.0.1           localhost
192.168.123.250     ceres
192.168.123.90      wap-downstairs
192.168.123.92      wap-upstairs
192.168.123.101     venus
192.168.123.165     algonquin
192.168.123.170     mercury
192.168.123.157     mars
192.168.123.190     sal2000

(Yes, I have a lot of computers :D ). When you edit the default /etc/hosts file, you'll see one funny IP address associated with the computer name localhost. Leave that one alone as it referrs to the local computer. 127.0.0.1 is a special IP address that means "myself".

Best of luck with your install.

- John
Back to top
View user's profile Send private message
hvedam
n00b
n00b


Joined: 17 Sep 2005
Posts: 38

PostPosted: Mon Sep 19, 2005 3:47 am    Post subject: Reply with quote

yeah you do...I specified my computer by 192.168.1.103 because that what routers gives as ip address, why would be neccessary/useful to specify this 127.0.0.1 ip address for my computer in the host file? my comp is known as genma. would I specify it 127.0.0.1 genma or 192.168.1.103 genma?
_________________
harushimo
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10459
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Sep 19, 2005 10:36 am    Post subject: Reply with quote

The purpose of the /etc/hosts file is to help your computer find other computers by name. In the /etc/hosts file on "genma", you don't really need a line that says "genma" or even the IP address of "genma". So, to illustrate, if you have just the one computer, your /etc/hosts file needs only this line:
Code:
127.0.0.1      localhost

Your computername, "genma" goes in /etc/conf.d/hostname, like so:
Code:
# /etc/conf.d/hostname

# Set to the hostname of this machine
HOSTNAME="genma"

Here's an example of what /etc/hosts should look like if you have a additional computer other than genma (let's call it "fred" and give it IP address 192.168.1.104 just as an example), then that computer would get an entry in /etc/hosts for "genma" and the /etc/hosts file on "genma" would get an entry for "fred".
So, the /etc/hosts on "genma" would be:
Code:
127.0.0.1      localhost
192.168.1.104  fred

And, the /etc/hosts on "fred" would be:
Code:
127.0.0.1      localhost
192.168.1.103  genma

Again, you don't need to look up yourself, so the 127.0.0.1 IP address (called the "loopback" address), which means "yourself" implicitly, is the right way to go: it's more efficient, too. Note that these simple guidelines change if you're setting up a larger network (and you have a lot more to set up). However, they're just fine for setting up a single computer or a very small network of computers.

- John
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10459
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Sep 19, 2005 10:42 am    Post subject: Reply with quote

Oh, yes, one more thing. Most modern home routers are configured with a web browser. Anyway, they have an IP address. If you want to refer to the router by name, say "myrouter", add this line to your /etc/hosts file (with the IP address of your router substituted for the one I give):
Code:
192.168.1.254  myrouter

In your web browser, you can then just put in the router's name as the address.

- John
Back to top
View user's profile Send private message
WhimpyPeon
Apprentice
Apprentice


Joined: 18 Oct 2003
Posts: 158
Location: Columbus, Nebraska

PostPosted: Mon Sep 19, 2005 7:11 pm    Post subject: Reply with quote

hvedam:

I hate to confuse your issue even more, but you should probably understand how your addresses are given out. You see, your router is acting as a dhcp server and assigning addresses to your computers. The router is probably set up with a range of addresses that it "hands out on request". As you stated you were given an address of 192.168.1.103. Based on that I am assuming that your router is using a range 192.168.1.100 - (something like) 192.168.1.200.

Depending on how your router handles leases you may not always get the same address. A prime example would be if you went on an extended vacation and turned off all of your computers. When you come back and start turning them back on you may get different addresses for your computers.

I would consider giving your computers a "static" address (assigned by you). If you look at your router's configuration you can see what range they are using for it's dynamic address pool. Then you can just use an address outside of the range (be sure to note things like dns server...). For instance you might want to give your computers addresses like 192.168.1.10 if that is outside of the dynamic address pool.

A lot of your "home based" routers use themselves for network functions like dns and default gateway. So for your setup you would set the following:

default gateway: 192.168.1.1
dns server: 192.168.1.1
Network Mask: 255.255.255.0

You might want to read through the relevant section of the Gentoo Handbook.

With static addresses you will never confuse /etc/hosts.

Good Luck!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum