I have a www.example.com
with X.X.Y.Y
ip i want to forward traffic from port 80 to the domain(www.example.com), I used the following iptable:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination X.X.Y.Y:80
but i dont get good result because X.X.Y.Y
content is not equal to the domain(www.example.com)
For ex: if you go to 198.252.206.16
(the ip of serverfault) with your browser you will see that result and content of the address(ip address) is not equl www.serverfault.com
.
I want to use domain in the above iptables rule, for ex:--to-destination www.example.com
(its just an example and i know its not working), how can i do this?
Is there any alternative way to do that without using iptables?
Thank you