You are not logged in.

#1 2009-07-16 15:06:05

sant527
Member
Registered: 2009-06-21
Posts: 273

Hostname

What is host name:

I found that there is a relationship btw /etc/rc.conf and /etc/hosts

I am not getting
My etc/rc.conf looks like this

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="myhost"

# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   - prefix an entry in INTERFACES with a ! to disable it
#   - no hyphens in your interface names - Bash doesn't like it
#
# DHCP:     Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#
eth0="dhcp"
INTERFACES=(eth0)


and my /etc/hosts looks like this

#
# /etc/hosts: static lookup table for host names
#

#<ip-address>    <hostname.domain.org>    <hostname>
127.0.0.1        localhost.localdomain    myhost

# End of file

Can any one help me to understand why one has to see that the host name in both the files should be same. And I have seen some one using

HOSTNAME="mybox.mydomain.com"

my to use such host name what are the advantages. What if I just use "ABCD" instead of "mybox.mydomain.com"

Offline

#2 2009-07-16 16:09:26

arkham
Member
From: Stockholm
Registered: 2008-10-26
Posts: 516
Website

Re: Hostname

Your /etc/hosts should be looking like:

127.0.0.1        localhost.localdomain    localhost    myhost


"I'm Winston Wolfe. I solve problems."

~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~

Offline

#3 2009-07-16 19:42:02

XFire
Member
From: UK
Registered: 2008-05-11
Posts: 192

Re: Hostname

Your host-name appears on router user lists and appears in the terminal. Also if you use a web server, you can use the host-name opposed to localhost in the web browser.


There is a difference between bleeding [edge] and haemorrhaging. - Allan

Offline

#4 2009-07-16 19:56:12

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Hostname

The only place I ever see it is in rtorrent's title bar.

Offline

#5 2009-07-16 22:32:39

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Hostname

Your hostname is a unique identifying name for your computer that is used in many, many different places.

The /etc/hosts file is a 'local' version of DNS which allows you to override normal DNS lookups by putting hostname/ip address pairs in the file.

Last edited by fukawi2 (2009-07-16 22:32:47)

Offline

#6 2009-07-17 16:03:00

sant527
Member
Registered: 2009-06-21
Posts: 273

Re: Hostname

thank you for your information

Offline

Board footer

Powered by FluxBB