Linux Netfilter discussions
 help / color / mirror / Atom feed
* DNAT based on domain name instead of IP address
@ 2004-01-28 23:22 Glen Lee Edwards
  2004-01-28 23:45 ` John A. Sullivan III
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Glen Lee Edwards @ 2004-01-28 23:22 UTC (permalink / raw)
  To: netfilter

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-01-29  0:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-28 23:22 DNAT based on domain name instead of IP address Glen Lee Edwards
2004-01-28 23:45 ` John A. Sullivan III
2004-01-29  0:01   ` Shawn
2004-01-28 23:47 ` Erik Bourget
2004-01-29  0:02   ` Shawn
2004-01-28 23:59 ` William Stearns

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox