LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   /etc/hosts (https://www.linuxquestions.org/questions/linux-networking-3/etc-hosts-406247/)

sharadshankar 01-21-2006 02:04 PM

/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

MS3FGX 01-21-2006 02:09 PM

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.

vls 01-21-2006 02:10 PM

/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.

sharadshankar 01-21-2006 02:28 PM

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?

vls 01-21-2006 02:40 PM

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


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