Networking Forums

Networking Forums > Computer Networking > Linux Networking > Configuring hostname, domainname, and IP address

Reply
Thread Tools Display Modes

Configuring hostname, domainname, and IP address

 
 
linuxquestion@yahoo.com
Guest
Posts: n/a

 
      01-02-2004, 12:13 AM
HI,

Sorry to ask another dumb question.

I want to configure my Redhat Advanced server 2.1 to
into a local network. I plan to have only two nodes.

hostname: red
ip address: 10.0.0.1
domainname: testrac.com

hostname: white
ip address: 10.0.0.2
domainname: testrac.com

So far, I am only working with the first machine, red.
I'm trying to get the machine to recognize itself as
red.testrac.com, at IP 10.0.0.1. On domain: testrac.com


I have modified these files:

cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 red red.testrac.com localhost.localdomain localhost
10.0.0.1 red red.testrac.com


cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=red.testrac.com



hostname
red.testrac.com

hostname --short
red

hostname --long
red
(odd. Why not the whole name?)


domainname
(none)

dnsdomainname
- nothing


ping red.testrac.com

PING red (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data.
64 bytes from red (127.0.0.1): icmp_seq=0 ttl=255 time=281 usec

- looks at 127.0.0.1, not 10.0.0.1


ping 10.0.0.1
connect: Network is unreachable

------------

I would like the command domainname to return:
testrac.com, and ping 10.0.0.1 to find itself.

What am I missing here? It is something with the dns?


Thanks
 
Reply With Quote
 
 
 
 
Charles LaCour
Guest
Posts: n/a

 
      01-02-2004, 12:51 AM
(E-Mail Removed) wrote:
> HI,
>
> Sorry to ask another dumb question.
>
> I want to configure my Redhat Advanced server 2.1 to
> into a local network. I plan to have only two nodes.
>
> hostname: red
> ip address: 10.0.0.1
> domainname: testrac.com
>
> hostname: white
> ip address: 10.0.0.2
> domainname: testrac.com
>
> So far, I am only working with the first machine, red.
> I'm trying to get the machine to recognize itself as
> red.testrac.com, at IP 10.0.0.1. On domain: testrac.com
>
>
> I have modified these files:
>
> cat /etc/hosts
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> 127.0.0.1 red red.testrac.com localhost.localdomain localhost
> 10.0.0.1 red red.testrac.com
>
>
> cat /etc/sysconfig/network
> NETWORKING=yes
> HOSTNAME=red.testrac.com
>
>
>
> hostname
> red.testrac.com
>
> hostname --short
> red
>
> hostname --long
> red
> (odd. Why not the whole name?)

Switch the red and the red.testrac.com in your host file.
>
>
> domainname
> (none)
>
> dnsdomainname
> - nothing
>
>
> ping red.testrac.com
>
> PING red (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data.
> 64 bytes from red (127.0.0.1): icmp_seq=0 ttl=255 time=281 usec
>
> - looks at 127.0.0.1, not 10.0.0.1

Look to your /etc/hosts file. You have red.testrac.com as 127.0.0.1 as
well as 10.0.0.1 and it is finding the 127.0.0.1 first. Remove the red
and red.testrac.com from the 127.0.0.1 line.
>
>
> ping 10.0.0.1
> connect: Network is unreachable
>
> ------------
>
> I would like the command domainname to return:
> testrac.com, and ping 10.0.0.1 to find itself.
>
> What am I missing here? It is something with the dns?
>
>
> Thanks

Off the top of my head I am not sure about the domainname commands
result but I will see what I can find.

--
Thanks
Charles LaCour
 
Reply With Quote
 
Brad Olin
Guest
Posts: n/a

 
      01-02-2004, 01:31 AM
On 1 Jan 2004 17:13:08 -0800, (E-Mail Removed) wrote:

>cat /etc/hosts
># Do not remove the following line, or various programs
># that require network functionality will fail.
>127.0.0.1 red red.testrac.com localhost.localdomain localhost
>10.0.0.1 red red.testrac.com
>
>

Umm try it this way...

127.0.0.1 localhost.localdomain localhost
10.0.0.1 red.testrac.com red

The lo and eth0 nics must have unique names (1st name after the IP
address) and unique aliases (subsequent names on same line).

>cat /etc/sysconfig/network
>NETWORKING=yes
>HOSTNAME=red.testrac.com
>
>

I think you should also have a gateway statement in the
/etc/sysconfig/network file, something like...

GATEWAY=10.0.0.254


FYI: The new convention is that .1 is the gateway device and the old
convention is that .254 is the gateway device. Truth be know, it can be
any valid IP within your network. Just be aware that most network
devices (like routers) will have a factory default of one or the other.


Brad
--
"Diplomacy is the art of letting someone else get your way."
Unknown
Bradley W. Olin
http://www.bwo1.com
 
Reply With Quote
 
Baho Utot
Guest
Posts: n/a

 
      01-02-2004, 03:01 AM
(E-Mail Removed) wrote:

> HI,
>
> Sorry to ask another dumb question.
>
> I want to configure my Redhat Advanced server 2.1 to
> into a local network. I plan to have only two nodes.
>
> hostname: red
> ip address: 10.0.0.1
> domainname: testrac.com
>
> hostname: white
> ip address: 10.0.0.2
> domainname: testrac.com
>
> So far, I am only working with the first machine, red.
> I'm trying to get the machine to recognize itself as
> red.testrac.com, at IP 10.0.0.1. On domain: testrac.com
>
>
> I have modified these files:
>
> cat /etc/hosts
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> 127.0.0.1 red red.testrac.com localhost.localdomain localhost
> 10.0.0.1 red red.testrac.com
>


The format is FQDN followed by aliases

This is what it should read instead
127.0.0.1 red.testrac.com red localhost.localdomain localhost
--------------- +++ +++++++++++++++++++++ +++++++++
where ---- is the fully qualified domainname
and ++++ are aliases

>
> cat /etc/sysconfig/network
> NETWORKING=yes
> HOSTNAME=red.testrac.com


Ok

> hostname --long
> red
> (odd. Why not the whole name?)


Because the hosts file is barfed

>
>
> domainname
> (none)


Ok

>
> dnsdomainname
> - nothing


Should read
dnsdomainname
testrac.com red


Later Dude
 
Reply With Quote
 
Bill Unruh
Guest
Posts: n/a

 
      01-02-2004, 05:38 PM
Baho Utot <baho-(E-Mail Removed)> writes:

](E-Mail Removed) wrote:

]> HI,
]>
]> Sorry to ask another dumb question.
]>
]> I want to configure my Redhat Advanced server 2.1 to
]> into a local network. I plan to have only two nodes.
]>
]> hostname: red
]> ip address: 10.0.0.1
]> domainname: testrac.com
]>
]> hostname: white
]> ip address: 10.0.0.2
]> domainname: testrac.com
]>
]> So far, I am only working with the first machine, red.
]> I'm trying to get the machine to recognize itself as
]> red.testrac.com, at IP 10.0.0.1. On domain: testrac.com
]>
]>
]> I have modified these files:
]>
]> cat /etc/hosts
]> # Do not remove the following line, or various programs
]> # that require network functionality will fail.
]> 127.0.0.1 red red.testrac.com localhost.localdomain localhost
Call this localhost and do not use the words red or red.testrac.com for
it. On reading the hosts file it is the FIRST instance which is taken.
This means that red would always come out as 127.0.0.1 which is not
always what you want.


]> 10.0.0.1 red red.testrac.com
]>

]The format is FQDN followed by aliases

]This is what it should read instead
] 127.0.0.1 red.testrac.com red localhost.localdomain localhost
] --------------- +++ +++++++++++++++++++++ +++++++++
]where ---- is the fully qualified domainname
]and ++++ are aliases

It does not really matter. It is just that the first name is what is
returned on a reverse lookup. If you are ok with it just returning red
your original is fine. I ahve loads of machines that do that and
everything works fine. In a hosts file there is no need for a fully
qualified domain name for local stuff.


]>
]> cat /etc/sysconfig/network
]> NETWORKING=yes
]> HOSTNAME=red.testrac.com

]Ok

]> hostname --long
]> red

Why do you care?
]> domainname
]> (none)

Why do you care?


]> dnsdomainname
]> - nothing

Why do you care?
 
Reply With Quote
 
Bill Unruh
Guest
Posts: n/a

 
      01-02-2004, 05:43 PM
Jeroen Geilman <(E-Mail Removed)> writes:

]> hostname: red
]> ip address: 10.0.0.1

]Don't do that - it is not officially allowed in IP networking.

]Use 10.1.1.1 if you must, but in any case you will have to set the
]netmask by hand to 255.255.255.0, as it is not a standard class C subnet.

Why? a zero in the non-last position is fine. Yes, you may have to set
the netmask by hand, but so what. And so what if it is 255.0.0.0? It is
a private address space anyway.


]>
]> PING red (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data.
]> 64 bytes from red (127.0.0.1): icmp_seq=0 ttl=255 time=281 usec
]>
]> - looks at 127.0.0.1, not 10.0.0.1

]Of course it does - you told it to!

Because teh first occurance of red in /etc/hosts is the 127.0.0.1 IP
address. It takes the first occurance.


]> ping 10.0.0.1
]> connect: Network is unreachable

This is a routing problem. What is the output of route?


 
Reply With Quote
 
linuxquestion@yahoo.com
Guest
Posts: n/a

 
      01-02-2004, 08:20 PM
Thanks for the responses. Ok, I tried this:

change /etc/hosts to:

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

reboot

ping -c 1 red
PING red.testrac.com (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data.
64 bytes from red.testrac.com (127.0.0.1): icmp_seq=0 ttl=255 time=302 usec

# ping -c 1 red.testrac.com
PING red.testrac.com (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data.
64 bytes from red.testrac.com (127.0.0.1): icmp_seq=0 ttl=255 time=17 usec

- it's still looking at 127.0.0.1

hostname --long
red.testrac.com

hostname --short
red


But, it still can't see the IP address that I want to assign
to this machine:

ping -c 1 10.0.0.1
connect: Network is unreachable

dnsdomainname
testrac.com

How do I assign the IP address to the machine?

Thanks


---------------

BTW, I notice that your domain is: philippines-island.org Two of
my girlfriends were Phillipina (not at the same time). They
picked me. They had long hair past their waist.


---------------


Baho Utot <baho-(E-Mail Removed)> wrote in message news:<e04fc1-(E-Mail Removed)>...
> (E-Mail Removed) wrote:
>
> > HI,
> >
> > Sorry to ask another dumb question.
> >
> > I want to configure my Redhat Advanced server 2.1 to
> > into a local network. I plan to have only two nodes.
> >
> > hostname: red
> > ip address: 10.0.0.1
> > domainname: testrac.com
> >
> > hostname: white
> > ip address: 10.0.0.2
> > domainname: testrac.com
> >
> > So far, I am only working with the first machine, red.
> > I'm trying to get the machine to recognize itself as
> > red.testrac.com, at IP 10.0.0.1. On domain: testrac.com
> >
> >
> > I have modified these files:
> >
> > cat /etc/hosts
> > # Do not remove the following line, or various programs
> > # that require network functionality will fail.
> > 127.0.0.1 red red.testrac.com localhost.localdomain localhost
> > 10.0.0.1 red red.testrac.com
> >

>
> The format is FQDN followed by aliases
>
> This is what it should read instead
> 127.0.0.1 red.testrac.com red localhost.localdomain localhost
> --------------- +++ +++++++++++++++++++++ +++++++++
> where ---- is the fully qualified domainname
> and ++++ are aliases
>
> >
> > cat /etc/sysconfig/network
> > NETWORKING=yes
> > HOSTNAME=red.testrac.com

>
> Ok
>
> > hostname --long
> > red
> > (odd. Why not the whole name?)

>
> Because the hosts file is barfed
>
> >
> >
> > domainname
> > (none)

>
> Ok
>
> >
> > dnsdomainname
> > - nothing

>
> Should read
> dnsdomainname
> testrac.com red
>
>
> Later Dude

 
Reply With Quote
 
Bit Twister
Guest
Posts: n/a

 
      01-02-2004, 08:51 PM
On 2 Jan 2004 13:20:44 -0800, (E-Mail Removed) wrote:
> Thanks for the responses. Ok, I tried this:
>
> change /etc/hosts to:
>
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> 127.0.0.1 red.testrac.com red localhost.localdomain localhost
> 10.0.0.1 red.testrac.com red
>
> reboot
>
> ping -c 1 red
> PING red.testrac.com (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data.
> 64 bytes from red.testrac.com (127.0.0.1): icmp_seq=0 ttl=255 time=302 usec
>
> # ping -c 1 red.testrac.com
> PING red.testrac.com (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data.
> 64 bytes from red.testrac.com (127.0.0.1): icmp_seq=0 ttl=255 time=17 usec



Well, make up your mind.
If you want 10,0,0,1
127.0.0.1 localhost.localdomain localhost
10.0.0.1 red.testrac.com red
or
127.0.0.1 red.testrac.com red localhost.localdomain localhost
 
Reply With Quote
 
Baho Utot
Guest
Posts: n/a

 
      01-02-2004, 10:01 PM
Bill Unruh wrote:

> Baho Utot <baho-(E-Mail Removed)> writes:
>
> ](E-Mail Removed) wrote:
>
> ]> HI,
> ]>
> ]> Sorry to ask another dumb question.
> ]>
> ]> I want to configure my Redhat Advanced server 2.1 to
> ]> into a local network. I plan to have only two nodes.
> ]>
> ]> hostname: red
> ]> ip address: 10.0.0.1
> ]> domainname: testrac.com
> ]>
> ]> hostname: white
> ]> ip address: 10.0.0.2
> ]> domainname: testrac.com
> ]>
> ]> So far, I am only working with the first machine, red.
> ]> I'm trying to get the machine to recognize itself as
> ]> red.testrac.com, at IP 10.0.0.1. On domain: testrac.com
> ]>
> ]>
> ]> I have modified these files:
> ]>
> ]> cat /etc/hosts
> ]> # Do not remove the following line, or various programs
> ]> # that require network functionality will fail.
> ]> 127.0.0.1 red red.testrac.com localhost.localdomain
> localhost Call this localhost and do not use the words red or
> red.testrac.com for it. On reading the hosts file it is the FIRST instance
> which is taken. This means that red would always come out as 127.0.0.1
> which is not always what you want.
>
>
> ]> 10.0.0.1 red red.testrac.com
> ]>
>
> ]The format is FQDN followed by aliases
>
> ]This is what it should read instead
> ] 127.0.0.1 red.testrac.com red localhost.localdomain localhost
> ] --------------- +++ +++++++++++++++++++++ +++++++++
> ]where ---- is the fully qualified domainname
> ]and ++++ are aliases
>
> It does not really matter. It is just that the first name is what is
> returned on a reverse lookup. If you are ok with it just returning red
> your original is fine. I ahve loads of machines that do that and
> everything works fine. In a hosts file there is no need for a fully
> qualified domain name for local stuff.


I was just giving them the proper format. If you want it set properly then
that is the way its supposed to be. I set things as they should be to
avoid problems later. Just because it works don't make it right.
I don't have any problem with my networking.


>
>
> ]>
> ]> cat /etc/sysconfig/network
> ]> NETWORKING=yes
> ]> HOSTNAME=red.testrac.com
>
> ]Ok
>
> ]> hostname --long
> ]> red
>
> Why do you care?


I don't

> ]> domainname
> ]> (none)
>
> Why do you care?


I don't
>
>
> ]> dnsdomainname
> ]> - nothing
>
> Why do you care?


I don't


 
Reply With Quote
 
Baho Utot
Guest
Posts: n/a

 
      01-02-2004, 10:01 PM
(E-Mail Removed) wrote:

> Thanks for the responses. Ok, I tried this:
>
> change /etc/hosts to:
>
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> 127.0.0.1 red.testrac.com red localhost.localdomain localhost
> 10.0.0.1 red.testrac.com red
>
> reboot
>
> ping -c 1 red
> PING red.testrac.com (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data.
> 64 bytes from red.testrac.com (127.0.0.1): icmp_seq=0 ttl=255 time=302
> usec
>
> # ping -c 1 red.testrac.com
> PING red.testrac.com (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data.
> 64 bytes from red.testrac.com (127.0.0.1): icmp_seq=0 ttl=255 time=17 usec
>
> - it's still looking at 127.0.0.1


Thats because the 127.0.0.1 line is before the 10.0.0.1 try to swap them.

>
> hostname --long
> red.testrac.com
>
> hostname --short
> red
>
>
> But, it still can't see the IP address that I want to assign
> to this machine:
>
> ping -c 1 10.0.0.1
> connect: Network is unreachable
>
> dnsdomainname
> testrac.com
>
> How do I assign the IP address to the machine?
>


If I understand the problem then it is assigned by ifconfig on boot, either
by DHCP or a static setting.


> BTW, I notice that your domain is: philippines-island.org Two of
> my girlfriends were Phillipina (not at the same time). They
> picked me. They had long hair past their waist.
>
>


Yes I don't think two at the same time works



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mac address & hostname automatic randomizer freeware for Windows jhailey@hotmail.com Wireless Internet 23 12-23-2008 10:23 PM
How to get hostname from IP address??? Neroku Linux Networking 4 04-22-2007 01:04 AM
how to resolve IP address to hostname arturo1957 Linux Networking 7 03-11-2007 06:18 PM
can't get internal ip address when ping hostname Fong Windows Networking 2 02-17-2006 03:04 AM
Problem with Hostname changing to IP Address Nathan Given Linux Networking 6 09-17-2003 02:37 PM



1 2 3 4 5 6 7 8 9 10 11