LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 01-21-2006, 02:04 PM   #1
sharadshankar
Member
 
Registered: Dec 2003
Posts: 43

Rep: Reputation: 15
/etc/hosts


I have a couple of websites in lan that I want to connect to. I can connect by putting the ip address and then the port number but I wanted to connect via words. I went to /etc/hosts and typed
Quote:
xxx.xxx.xx.xxx tigthvnc.ondemand.org
Well that didn't work. It works from the computer itself but doesn't work with any other computers in the lan. So then I went to /etc/host.conf and made sure host was there behind bind and it was. I'm running Ubuntu right now. I did try to share internet with other computers before but was unsuccessful. I messed around with the iptables and installed dnsmasq and ipmasq before. I uninstalled those two programs but I don't know, there may be something still there. Anyways, do you think the iptables has anything to do with this? Here is the guide I was using.
http://ubuntuforums.org/showthread.p...share+internet
 
Old 01-21-2006, 02:09 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
The entries in /etc/host only effect that local computer, not the rest of the LAN.

The only time it would effect another computer is if you had a second computer not only connecting to the internet though the Ubuntu machine, but also were running dnsmasq or a full DNS server on the Ubuntu machine.

You are saying you are doing neither of those things (at least not anymore), so then you are not able to pass on the entires in /etc/hosts to the other clients on the LAN.

To do that, you would need to run a small DNS server on a computer in your LAN.
 
Old 01-21-2006, 02:10 PM   #3
vls
Member
 
Registered: Jan 2005
Location: The grassy knoll
Distribution: Slackware,Debian
Posts: 192

Rep: Reputation: 31
/etc/hosts only works on the machine the file is on. You have to have the file on each machine.

Edit: You need the line 'order hosts,bind' in /etc/resolv.conf also, I believe.

A bit of trivia: the hosts file was how ip address/machine names were passed around on the Internet before DNS was invented.

Last edited by vls; 01-21-2006 at 02:13 PM.
 
Old 01-21-2006, 02:28 PM   #4
sharadshankar
Member
 
Registered: Dec 2003
Posts: 43

Original Poster
Rep: Reputation: 15
ok thanks guys, but my other computers have windows xp. I want to connect to those website from my xp. What should I install in ubuntu? How should I configure it?
 
Old 01-21-2006, 02:40 PM   #5
vls
Member
 
Registered: Jan 2005
Location: The grassy knoll
Distribution: Slackware,Debian
Posts: 192

Rep: Reputation: 31
You set up a hosts file on the windows machine just like on your Linux machine.
It's in c:\Windows\system32\drivers\etc\
 
  


Reply



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
External Hosts Resolve but Local Hosts Do Not kjm9 Linux - Networking 7 11-19-2005 03:51 PM
hosts.allow & hosts.deny question... jonc Linux - Security 9 03-05-2005 09:41 PM
Adding shell commands to hosts.deny and hosts.allow ridertech Linux - Security 3 12-29-2003 03:52 PM
hosts.deny and hosts.allow defaults? gui10 Linux - Security 5 12-20-2001 01:57 AM
hosts.allow / hosts.deny fistz Linux - Newbie 1 04-19-2001 07:00 PM

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

All times are GMT -5. The time now is 10:53 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