Results 1 to 6 of 6
I am running a Fedora Core server that is acting as the router for several computers. I would like several websites to be redirected to a certain IP address. I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-23-2006 #1Just Joined!
- Join Date
- Oct 2006
- Posts
- 2
DNS Configuration
I am running a Fedora Core server that is acting as the router for several computers. I would like several websites to be redirected to a certain IP address. I know this can be accomplished with the hosts file, like the example below:
I tried this in the hosts file but it seems to only work on the local machine and not the clients. Does anyone know how to "push" this to the clients or an alternative method of accomplishing this task?Code:192.168.1.1 www.google.com
Thanks!
- 10-23-2006 #2
iptables
I think you might want to look into iptables and FORWARD rules.
http://www.linuxguruz.com/iptables/h...O-6.html#ss6.4
- 10-23-2006 #3
If you run your own DNS server on the FC5 machine, and have every other machine on the network use the server for it's DNS, then you can make your server provide whatever IP address you like in response to any request it receives from the lan.
Take a look at the man pages for 'bind'.Linux user #126863 - see http://linuxcounter.net/
- 10-23-2006 #4Just Joined!
- Join Date
- Oct 2006
- Posts
- 2
Am I on the right track?
iptables -t nat -A PREROUTING -p tcp -d www.google.com --dport 80 -j DNAT --to 216.109.112.135
So if I try to go to www.google.com it should take me to 216.109.112.135. This doesn't seem to be working.
- 10-25-2006 #5Just Joined!
- Join Date
- Aug 2006
- Location
- Ripon, UK
- Posts
- 26
There used to be an little app called DNSmasq that did just what you are looking for - used the hosts table as a lookup for answering DNS queries (and sent anything that didn't match to your usual DNS service). I have an old version if you can't find uptodate anywhere.
- 10-27-2006 #6
Re:...DNS Configuration
ctg3,
in your firewall iptables rule collection, the nat/PREROUTING
rule is good.
but not enough... you should also have these rules somewhere appropriate:
iptables -A INPUT -i $EXTERNAL_IF -p tcp --dport 80 -j ACCEPT
...
iptables -A FORWARD -i $EXTERNAL_IF -p tcp --dport 80 -j ACCEPT
where EXTERNAL_IF=eth0 for eg.
cuervo


Reply With Quote
