LinuxQuestions.org
Review your favorite Linux distribution.
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 11-12-2004, 02:38 PM   #1
Paxmaster
Member
 
Registered: Jun 2004
Location: unknown place in NYC
Distribution: Ubuntu
Posts: 377

Rep: Reputation: 30
Unhappy something is wrong with my hostname


i can ping my fc2 on my laptop,. but can't ping the hosts name, i am not familar with networking, but i do have general knowldge. the dns what makes the hostsname to ipaddress, am i correct or no. I am trying to get vnc working, but i am getting sick of it


first of all let me get this, i have cable, a router, 3 desktop and a laptop. The router gives indivisal computers it own ipaddress thats called Lan ip, by it self router has it own ipaddress which i could log in and change it setting, am i correct . The isp has his own ipaddress that how the port 80 connect.

if i could send a packet to fedora or winblow that means i should able to connect. i could connect with ssh ********but i only connect by it ipaddress not by host name**********

that mean something is wrong with the host or i could be worng
 
Old 11-12-2004, 03:23 PM   #2
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
Ping IP, but not hostname = edit your hosts file:

Linux: /etc/hosts
Windows: c:\windows\system32\drivers\etc\hosts
^^ although i don't know that's accurate for all versions...
 
Old 11-12-2004, 03:30 PM   #3
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
more: this is a dns issue... i suppose if you listed your router as one of your dns servers, you might work around it that way, but the hosts file is *i think* better... i would also suggest moving your machines that host services to static IPs so that you do not need to edit your hosts file(s) if your IPs roll...
 
Old 11-12-2004, 03:30 PM   #4
phatboyz
Member
 
Registered: Feb 2004
Location: Mooresville NC
Distribution: CentOS 4,Free BSD,
Posts: 358

Rep: Reputation: 30
windows XP Home
c:\windows\system32\drivers\etc\edit hosts
Windows 95-98
c:\windows\edit hosts
Window XP Pro,2000,NT
c:\winnt\system32\drivers\etc\edit hosts


linux

/etc/hosts
127.0.0.1 localhost.localdomain nameofcomputer

Windows

ipaddy nameoflinuxserver

Last edited by phatboyz; 11-12-2004 at 04:18 PM.
 
Old 11-12-2004, 04:11 PM   #5
Paxmaster
Member
 
Registered: Jun 2004
Location: unknown place in NYC
Distribution: Ubuntu
Posts: 377

Original Poster
Rep: Reputation: 30
my hosts contain these lines

127.0.0.1 <name of my computers> <nameofmycomputer.domain.com> <localhost>
--------------------------------------------------------------------------------------------------
the first time i install fc2 on my laptop i had change my host name to new one.
---------------------------------------------------------------------------------------------------
should i get rid of localhost.

does the order metter <name of my computers> <nameofmycomputer.domain.com> , as phatboyz = <nameofmycomputer.domain.com> <name of my computers>
 
Old 11-12-2004, 04:15 PM   #6
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
NO!!! do NOT EVER remove localhost!
 
Old 11-12-2004, 04:19 PM   #7
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
what order?

there is a syntax to follow... phatboyz listed it:

Quote:
(modified)
linux syntax:
ipadress nameofcomputer.nameofdomain nameofcomputer

windows syntax:
ipaddress nameofcomputer.withdomain
 
Old 11-12-2004, 04:19 PM   #8
phatboyz
Member
 
Registered: Feb 2004
Location: Mooresville NC
Distribution: CentOS 4,Free BSD,
Posts: 358

Rep: Reputation: 30
I edited my previous post it should be

127.0.0.1 localhost.localdomain nameofcomputer
 
Old 11-12-2004, 04:28 PM   #9
Paxmaster
Member
 
Registered: Jun 2004
Location: unknown place in NYC
Distribution: Ubuntu
Posts: 377

Original Poster
Rep: Reputation: 30
what line i have to put to the window hosts anyway i aready have the router as a dns server i think

resolv.conf
; generated by /sbin/dhclient-script
nameserver 192.***.*.***
 
Old 11-12-2004, 04:39 PM   #10
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
ok... let's take a small example:

runnning /sbin/ifconfig on your linux box reveals it's address is '192.168.1.100', and the hostname is 'mylinuxbox'

now therefore you should append your windows hosts file with:
Code:
192.168.1.100 mylinuxbox
now you should be able to open a command prompt in windows, and run 'ping mylinuxbox', and get some response verifying address resolution

[edit]you know, after you save your hosts file[/edit]

Last edited by secesh; 11-12-2004 at 04:40 PM.
 
Old 11-12-2004, 06:50 PM   #11
Paxmaster
Member
 
Registered: Jun 2004
Location: unknown place in NYC
Distribution: Ubuntu
Posts: 377

Original Poster
Rep: Reputation: 30
at right now let me add somthink to it. i am setting right now on my laptop i am pinging my myself with the ipaddress, it works, but when i try to ping my host name it don't works. the MAJOR problem is my hostname. it is not picking up.

i think i know what is the problem see i could ping my LAN IP ADDRESS (within home network) and the HOST i think first it connect to the server of isp then it try to find the host name which it cannot, i could PING my computer because it within and the router can detect it easy. do u see where i am going at.

by the way which port vnc is listening to. or how could i found out which port.

I did what you me to do but it still didn't work thanks secesh for your time i am really appicate your help


By the way i have a stupid or genuis idea it depen on how u look at it. here it goes

as i mention to u i could ssh from my win to fc2 it work great, would i able to connect vnc to ssh on the same box then try to connect to linux or ssh to vnc to my linux box
 
Old 11-12-2004, 07:05 PM   #12
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
Quote:
at right now let me add somthink to it. i am setting right now on my laptop i am pinging my myself with the ipaddress, it works, but when i try to ping my host name it don't works. the MAJOR problem is my hostname. it is not picking up.
yes, this is the point to putting in the info to the hosts file... it works as a dns bypass... if you can ping by ip, but not hostname, then an entry in the hosts file will correct that.

so let's start over with 1) what is the IP of your linux box? and 2) what is the hostname of the linux box?

and just to verify:
from your windows box you 1) can ping the IP of your linux box, but 2) can NOT ping the hostname.
 
Old 11-12-2004, 07:17 PM   #13
Paxmaster
Member
 
Registered: Jun 2004
Location: unknown place in NYC
Distribution: Ubuntu
Posts: 377

Original Poster
Rep: Reputation: 30
hey hey hey

fix the problem i disable the iptable now i could ping with host cheers

do i need a iptable if i have a router or how could i set up iptable that will not messup the host name

then on i restart ip table

i could ping hostname, i don't understand it works wow very wired thanks anywhere

Last edited by Paxmaster; 11-12-2004 at 07:35 PM.
 
  


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
RedHat Enterprise wrong hostname with POP3 AwoLtheMighty Red Hat 3 08-09-2005 11:38 PM
Wrong Hostname in the DNS and DHCP Address Leases of Windows 2000 saneax Linux - Networking 1 03-03-2005 04:14 AM
my time is wrong and calender is also wrong Paxmaster Linux - General 6 12-16-2004 01:46 AM
Wrong Hostname in a MS Domain Zeb Linux - Networking 0 03-16-2004 04:32 AM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 06:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:09 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration