Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Shawn <core@enodev.com>
To: Erik Bourget <erik@midmaine.com>
Cc: Glen Lee Edwards <glen@holiness.ch>,
	"netfilter@lists.netfilter.org" <netfilter@lists.netfilter.org>
Subject: Re: DNAT based on domain name instead of IP address
Date: Wed, 28 Jan 2004 18:02:26 -0600	[thread overview]
Message-ID: <1075334545.11612.27.camel@localhost> (raw)
In-Reply-To: <87llnr1vqq.fsf@loki.odinnet>

Yeah, only he does not have any "one true apache" server answering. I
thnik that is, however, what he /should/ do.

On Wed, 2004-01-28 at 17:47, Erik Bourget wrote:
> Glen Lee Edwards <glen@holiness.ch> writes:
> 
> > 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.
> 
> TCP packets know nothing of DNS ... an application will 1) look up the name at
> a DNS server, 2) retrieve the IP from the DNS server, and 3) connect to the IP
> address.
> 
> Apache can do virtual domains ... HTTP 1.1 requires that you specify the
> domain name.
> 
> - Erik
> 
> 


  reply	other threads:[~2004-01-29  0:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2004-01-28 23:59 ` William Stearns

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1075334545.11612.27.camel@localhost \
    --to=core@enodev.com \
    --cc=erik@midmaine.com \
    --cc=glen@holiness.ch \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox