DNAT based on domain name instead of IP address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have several domains that use the same IP address.  Can I DNAT them to
different servers based on domain name instead of IP address using
iptables?  I've tried the following, but it isn't working:

iptables -t nat -A PREROUTING -p tcp -d 1st.domain.com --dport 80 -j
DNAT --to-destination 192.168.1.12:80

iptables -t nat -A PREROUTING -p tcp -d 2nd.domain.com --dport 80 -j
DNAT --to-destination 192.168.1.13:80

Everything is being forwarded to 192.168.1.12 no matter which domain is
used.  It appears that the domains are first being translated into the
IP address, which is used instead.

Glen



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux