You are not logged in.

#1 2009-11-18 00:28:18

JoeKer1086
Member
Registered: 2009-11-16
Posts: 45

Initial setup and /etc/hosts help

ok. I am getting ready to do my first install and am reading through the wiki very thoroughly but i am stuck at this section. I want to set up a static IP and I have understood everything (for the most part) up to this point. The problem I am having with this section is the line 
If you use a static IP, add another line using the syntax: <static-IP> <hostname.domainname.org> <hostname> e.g.:

192.168.1.100 yourhostname.domain.org  yourhostname

I don't know what I would put for this.....i get the ip address but not the yourhostname.domain.org and yourhostname..... if my computer is named joeker that would be the yourhostname part i think, but that still leaves the yourhostname.domain.org.... any ideas? below is the full section from the wiki.







/etc/hosts

This file associates IP addresses with hostnames and aliases, one line per IP address. For each host a single line should be present with the following information:

<IP-address> <hostname> [aliases...]

Add your hostname, coinciding with the one specified in /etc/rc.conf, as an alias, so that it looks like this:

127.0.0.1   localhost.localdomain   localhost yourhostname

Note: This format, including the 'localhost' and your actual host name, is required for program compatibility! So, if you have named your computer Archhost, then that line above should look like this:

127.0.0.1   localhost.localdomain   localhost Archhost

Errors in this entry may cause poor network performance and/or certain programs to open very slowly, or not work at all. This is a very common error for beginners.

If you use a static IP, add another line using the syntax: <static-IP> <hostname.domainname.org> <hostname> e.g.:

192.168.1.100 yourhostname.domain.org  yourhostname

Tip: For convenience, you may also use /etc/hosts aliases for hosts on your network, and/or on the Web, e.g.:

64.233.169.103   www.google.com   g
192.168.1.90   media
192.168.1.88   data

The above example would allow you to access google simply by typing 'g' into your browser, and access to a media and data server on your network by name and without the need for typing out their respective IP addresses.


I understand it completely, grappled hopelessly with comprehension, balanced on the edge of insanity for an eternity.....a moment.

Offline

#2 2009-11-18 00:44:42

jmss
Member
From: Lisboa, Portugal
Registered: 2006-10-24
Posts: 42

Re: Initial setup and /etc/hosts help

Hi,

I think it can be anything, like "localdomain" in some known examples.

Unless you are inside a domain, like a univesity network for instance.

Or if you have a dyndns.org name, you can use:

<your name>.dyndns.org

Last edited by jmss (2009-11-18 00:45:28)


João M. S. Silva

Offline

#3 2009-11-18 00:51:15

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: Initial setup and /etc/hosts help

It's ever so easy - though it does depend on whether or not your ISP provide you with a fixed or dynamic ip-address.
For my own case - which may be the easiest to explain - my ISP uses a dynamic IP-address, but then I have a router between my computers and the satellite modem.
Thus - my satellite modem has 192.168.0.1 on _my_ side.
My router has dynamic ip on the outgoing side (usually ends up as 192.168.0.2), but serves both dynamic and fixed addresses on the incoming side. Default for the router is 192.168.1.2-99 (its own port address is 192.168.1.1) and 192.168.1.151-254 are static and 192.168.1.100-150 are dynamic.
Thus - if I want one of my (many) computers to have a static address of 192.168.1.7 (say), then my affected files would be:

/etc/hosts
127.0.0.1  localhost
192.168.1.7 the-name-of-my-arch-computer
/etc/resolv.conf
nameserver 192.168.1.1

As long as you work behind a router like that - you don't need to worry about domain-names.
Infact, domain names are really only applicable for computers that are reachable from the outside (ie the www-side).

Last edited by perbh (2009-11-18 00:55:20)

Offline

#4 2009-11-18 01:05:46

JoeKer1086
Member
Registered: 2009-11-16
Posts: 45

Re: Initial setup and /etc/hosts help

ok so lets say the ip address of my router is 192.168.1.1 and i want my static IP addresss to be 192.168.1.50 how would i set that up....? still a little confused, sorry.

would it be

/etc/hosts

127.0.0.1   localhost
192.168.1.50 JoeKer
/etc/resolv.conf
nameserver 192.168.1.1

??? is that right?

Last edited by JoeKer1086 (2009-11-18 01:08:40)


I understand it completely, grappled hopelessly with comprehension, balanced on the edge of insanity for an eternity.....a moment.

Offline

#5 2009-11-18 02:36:10

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Initial setup and /etc/hosts help

Looks fine, as long as you are being automatically assigned a dns server. If not, you could use

nameserver 208.67.222.222
nameserver 208.67.220.220

(to use OpenDNS, which is pretty good)

Offline

Board footer

Powered by FluxBB