LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-09-2003, 10:42 PM   #1
bm1
Member
 
Registered: Nov 2002
Location: NZ
Distribution: freeBSD, slack
Posts: 156

Rep: Reputation: 30
hostname problem


i am setting up samba, i can ping windows to linux ip but not hostname. on linux to windows i can ping ip and hostname. have i changed the right files? the error i get when trying to enter linux through windows is "cant find path" so im thinking it might have something to do with the hostname?????????? the hostname is changed so far as i can tell. except when i try to ping the hostname. i read somewhere to change the resolv.conf but still the same error
thanks

does redhat 8 have firewall setting that i have to change???
i have just ping the old hostname and it timed out?? i must have not changed the hostname properly? anyone know the files that i have to modify for redhat 8

Last edited by bm1; 05-09-2003 at 10:59 PM.
 
Old 05-09-2003, 11:57 PM   #2
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
the hostname is set by the command..

hostname name

pinging by hostname requires the dns server your using to know the address of the name your pinging unless your pinging locally.

If you don't want to use dns you will need to add the hostnames and ip addresses to the files /etc/resolv.conf in linux, and hosts in windows .
 
Old 05-10-2003, 12:06 AM   #3
bm1
Member
 
Registered: Nov 2002
Location: NZ
Distribution: freeBSD, slack
Posts: 156

Original Poster
Rep: Reputation: 30
my network is connected through a cross over cable( only 2 comps) im not sure what type of network it is called. is it locally?
im not sure how linux dns works but its pinging my windows comp (hostname and ip). my windows comp cant ping my linux comp (hostname) but can ping the ip.
i left the dns blank in windows cause i dont know how to set it. is this the problem? and how do i set it?
thanks

Last edited by bm1; 05-10-2003 at 12:09 AM.
 
Old 05-10-2003, 01:21 AM   #4
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
you can run bind on the linux box and use it for dns, or just add the hosts to the hosts file


when I say locally I mean on the box named rufus type this

ping rufus
 
Old 05-10-2003, 01:57 AM   #5
bm1
Member
 
Registered: Nov 2002
Location: NZ
Distribution: freeBSD, slack
Posts: 156

Original Poster
Rep: Reputation: 30
if i want windows to recognise the hostname of my linux comp. could i just add the linux comp ip address in the dns text box for winxp? or does the dns have to be something different. i just want windows to recognise the hostname of my linux comp.
 
Old 05-10-2003, 09:05 PM   #6
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
no you add it to your hosts file

dns must have a dns server
 
Old 05-11-2003, 02:03 AM   #7
bm1
Member
 
Registered: Nov 2002
Location: NZ
Distribution: freeBSD, slack
Posts: 156

Original Poster
Rep: Reputation: 30
my hosts file is

127.0.0.1 bmlinux localhost.localdomain localhost
192.168.1.2 bmlinux

is there something wrong with this /etc/hosts file
i have also created a file called /etc/hostname which has

bmlinux.localdomain

i have also changed /etc/sysconfig/network to

HOSTNAME=bmlinux.localdaomain

can you see anything i have done wrong????
thanks

Last edited by bm1; 05-11-2003 at 02:05 AM.
 
Old 05-11-2003, 05:45 PM   #8
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
That's not what I meant.

For windows to access linux by name (I thought that was the problem) on the windows machine without a valid dns entry you need to add the linux computers ip address and hostname to the hosts file

It needs to be in the path, the most common place to put it is in c:\hosts or c:\windows\hosts


see c:\windows\hosts.sam for a sample
 
Old 05-12-2003, 05:34 AM   #9
bm1
Member
 
Registered: Nov 2002
Location: NZ
Distribution: freeBSD, slack
Posts: 156

Original Poster
Rep: Reputation: 30
i found a file on windows called c:\WINDOWS\system32\drivers\etc

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost
192.168.1.2 bmlinux.localdomain

i added bmlinux.localdomain is this correct??
thanks
 
Old 05-12-2003, 06:08 AM   #10
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
you can use that name now,

try this

ping bmlinux.localdomain
 
Old 05-12-2003, 06:12 AM   #11
bm1
Member
 
Registered: Nov 2002
Location: NZ
Distribution: freeBSD, slack
Posts: 156

Original Poster
Rep: Reputation: 30
thanks heaps its finally working. yeah(sigh of relief). i have a different prob now. and i posted it in software. just keep eliminating until theres no more probs. thanks david
 
Old 05-12-2003, 02:14 PM   #12
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
cool

your welcome
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hostname problem c_dave1 Linux - Networking 8 07-11-2005 11:38 PM
hostname problem matrixon Linux - Software 3 06-24-2005 03:27 PM
Hostname - Problem ??? aurelio26 Linux - Newbie 3 10-04-2004 12:06 AM
hostname problem jnewing Red Hat 1 06-01-2004 06:23 PM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 05:01 PM


All times are GMT -5. The time now is 11:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration