How do I route internally based on the domain being accessed?

Posted on 2008-11-07
Last Modified: 2012-05-05
Say I have two subdomains,, and I want my 831 to examine the header, sort-of like apache's virtualhosts do, and based on the IP, send the request to one of my servers.

So - say I have a server on, and one on I want anything accessed by to go to, and anything from to go to

I only have ONE external IP. I think this is possible, but not sure how to do it, or even what to look up.
Question by:kb3llm
    LVL 23

    Accepted Solution

    That you have only 1 external ip is a problem.  And there are ways to handle it,  but I am not aware of a Cisco 831 being capable of this.

    What you have is commonly treated as a load balancing / content switching problem, not a routing problem  (you want to direct requests to the same IP to different dedicated servers based on domain requested).    A common way of doing this is to setup a load balancer appliance;  the load balancer can be configured to forward different domains to different dedicated servers.

    A reverse proxy, for example squid, apache, pound on a dedicated Linux server, or say a  Cisco Content Engine appliance,  etc   can also forward the request to the desired frontend webserver based on domain name.

    Routers choose the destination based on the IP address in the headers.

    Or with policy routing: based on the source address and other criteria like port numbers.

    However, when a HTTP request is made, the  DOMAIN NAME is not in the packets at layer 3,  it is only sent inside the actual HTTP request stream.

    Your router (and even the destination server)  cannot know the domain name, or tell whether the user entered  or entered http://(ip addresss)  into their browser,  without a thorough examination of Application layer data.

    Layer 7 inspection of all traffic is expensive, in that the equipment requires special support for it, and a fair amount of CPU power.  The Cisco 831 has fairly little CPU power and doesn't do deep packet inspections.

    Something other than a Cisco 831 is really required in order to switch based on domain name in the HTTP request.

    Something routing a request based on destination domain needs to examine the request down to the application layer,  before a decision can be made based on domain name.


    Author Closing Comment

    Thanks for the informative reply. It makes sense, though it's unfortunate. Oh well - thanks again.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Occasionally you run into the website or two that will not resolve properly using your own DNS servers.  Some people simply set up global forwarders for their DNS server.  I don’t recommend doing this because it can cause problems resolving addresse…
    Configuring network clients can be a chore, especially if there are a large number of them or a lot of itinerant users.  DHCP dynamically manages this process, much to the relief of users and administrators alike!
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now