LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   host file equiv... (https://www.linuxquestions.org/questions/linux-networking-3/host-file-equiv-318430/)

TotalLinuxNoob 04-29-2005 09:21 AM

host file equiv...
 
In win I was able to edit the host file to block/unblock/reroute sites - is there anything equivelant in Linux?
Many thanx

apsivam 04-29-2005 09:42 AM

which host file you mean to say under windows. If its %WINDIR%\System32\drivers\etc\hosts then

its /etc/hosts in linux.

TotalLinuxNoob 04-29-2005 09:53 AM

Many thanx..

To whether it would work I forwarded altavista to google :P
but no joy. Whats wrong with the bottom line:

127.0.0.1 localhost.localdomain localhost
127.0.0.1 Athene
66.218.71.198 216.239.37.99


Cheers:)

apsivam 04-30-2005 04:18 AM

/etc/hosts file cannot be used for this kind of redirection it is there to map hostname to ip address translation it has to be

1.2.3.4 hostname.domainname

TotalLinuxNoob 05-07-2005 06:25 PM

Ah... ok. Many thanx..

So it more or less locally stores the host name and it's respective IP?
So in that case could you set the IP of a hostname to something else and thus redirect it?
E.g.
IPofAltavista www.google.com

That means one could still access the site by entering the IP instead of it's url.

Sorry but I have to stay true to my [descriptive] name...:o

TotalLinuxNoob 05-14-2005 12:14 PM

IF that's not it - is there anyway to block access to a site on a FC3 system? Without a 3rd party utility?

thanx

Poetics 05-14-2005 05:38 PM

Watch out, because most large websites have mulitple IPs -- there was a thread around here about that the other week, actually (blocking multiple IPs). If you want to give them a 404 error, you can just do "127.0.0.1 altavista.com"

Else, you can look into iptables, I believe


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