Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a simple way to route certain domains (i.e. through a different network interface. Here is the situation. I have a server with two interfaces eth0 going to the local network and tun0 going to an openvpn network. I would like to have all requests going to * go out tun0 and the rest go through eth0. Is there a simple way to do this using names as opposed to ip addresses?

share|improve this question
up vote 1 down vote accepted

Not so much. The routing system is definitely IP based and names have no meaning. By the time traffic gets to the level of routing it has been turned from a name into a number. Any system that claims to do this is just dereferencing domain names to their IP components.

share|improve this answer
That sucks... :). Any pointers on what to look next? – rmarimon Jan 25 '11 at 21:18
@rmarimon Pretty much what you already know. Set up static routes to the debian subnets you want tunneled. – sysadmin1138 Jan 25 '11 at 21:32

What kind of traffic are you routing?

If it's HTTP, you could configure vhosts and proxy * to IP addresses or domain names that resolve to IP's on the tun0 subnet. You can use modproxy or modrewrite for this. If your routes are setup correctly and it's just HTTP traffic, this should work.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.