I have a
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
18.104.22.168(the ip of serverfault) with your browser you will see that result and content of the address(ip address) is not equl
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?