Red Hat Networking - hosts file

This is Interesting: Free IT Magazines  
Home > Archive > Red Hat Networking > February 2004 > hosts file





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author hosts file
Marcel Bootsman

2004-02-17, 9:33 pm

Hello,

i am creating a detailed plan for setting up my RH9 machine as a web/mail
server.
It is going to host a domain, let's call it www.domain.com.
My current hosts file looks like this:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost servername

where servername is the name of the machine.

Now what changes would I have to make if i am going to have the domain.com
point to this machine?
thanks !



Alexander Dalloz

2004-02-18, 2:34 am

On Wed, 18 Feb 2004 11:20:46 +0100 Marcel Bootsman wrote:

> Hello,
>
> i am creating a detailed plan for setting up my RH9 machine as a web/mail
> server.
> It is going to host a domain, let's call it www.domain.com.
> My current hosts file looks like this:
>
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> 127.0.0.1 localhost.localdomain localhost servername
>
> where servername is the name of the machine.
>
> Now what changes would I have to make if i am going to have the domain.com
> point to this machine?
> thanks !


You need to set up a proper DNS zone for your domain on the DNS server
responsible for the domain.

The /etc/hosts file you should change to

127.0.0.1 localhost.localdomain localhost
123.123.123.4 host.domain.com host


Alexander


--
Alexander Dalloz | Enger, Germany
PGP key valid: made 13.07.1999
PGP fingerprint: 2307 88FD 2D41 038E 7416 14CD E197 6E88 ED69 5653

Charles LaCour

2004-02-18, 2:33 pm

Marcel Bootsman wrote:
> Hello,
>
> i am creating a detailed plan for setting up my RH9 machine as a web/mail
> server.
> It is going to host a domain, let's call it www.domain.com.
> My current hosts file looks like this:
>
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> 127.0.0.1 localhost.localdomain localhost servername
>
> where servername is the name of the machine.
>
> Now what changes would I have to make if i am going to have the domain.com
> point to this machine?
> thanks !
>
>
>

The host file on your machine is for name and IP resolution on your
machine only. It has no relation to other computers resolving your
computers name.

There are a number of things that need to be done. First of all where
is this computer to be available from? Internal network or Internet or
both? What is going to be the method of name resolution? If it is
going to be accessed from the Internet you will need the name
www.domain.com to resolve to the IP address for the server or the IP
address on the firewall that will pass the requests to it.

In any case I would add to your hosts file a line with the IP address of
your computer with the name you want for the computer. For example:
192.168.1.100 servername.domain.com servername www.domain.com

I would leave the loopback entry in your host file alone, it should be:
127.0.0.1 localhost.localdomain localhost

To configure what your RH9 computer shows as your hostname take a look
at the file /usr/share/doc/initscripts-*/sysconfig.txt and look at the
info on the /etc/sysconfig/network and
/etc/sysconfig/network-scripts/ifcfg-<interface-name> files.

For name resolution look at the hosts entry in the /etc/nsswitch.conf
file. And look at resolv.conf. You should probably do a man on both
for the details.

If you do not already have a DNS server you will need to set up DNS as
well. This is beyond what I am prepared to write about. You may be
able to get it functioning with bindconf but if you are going to host
your own DNS I would invest on a good book or two (O'Reilly's book on
DNS & Bind is one of my favorites).

If it is going to be accessed through a firewall or a router with NAT
you will have to configure access through that as well.

If you are going to set up sendmail for your MTA I would be very careful
in configuring it since it is easy to leave it open as a spam relay.

If you could be a little more specific about what you are trying to do
and what the environment that the server is going into I may be able to
be more helpful.

--
Thanks
Charles LaCour
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com