I currently have my Time Capsule to forward all inbound requests on port 80 to my Mac Mini which runs a web server with its local ip address of I also have DNS set up so that if I go to example.com then it will send the request to my static public IP which will in turn cause the Time Capsule to forward the request on port 80 to my Mac Mini.

However I now have a Raspberry Pi on the local network also, with the ip address of I want to be able to access the web server on the Raspberry Pi by going to pi.example.com, but I'm not sure how I can get the Time Capsule to port forward based on the domain. What I'd like to be able to have is something that works like this:

example.com:80       -->   public IP   -->
pi.example.com:80    -->   public IP   -->

NB: Posted this on apple.stackexchange.com as it relates to the Time Capsule, however it may be better suited on ServerFault, if so I ask if the moderators could kindly move it there.


The Time Capsule cannot port forward based on incoming domain request. It is not aware of the domain requested, only the port you are attempting to access. You need software, like properly-configured Apache, to handle multiple virtual domains within a network. I am not knowledgeable enough of the topic to advise you specifics, but it would involve handing off DNS and/or routing duties to a server (such as the Pi or OS X Server) and putting the Time Capsule in bridge mode.

A better way to do this is to hit the Raspberry Pi at another public port, such as example.com:81. The Time Capsule can handle this with ease.

  • Putting it on another public port wouldn't let me use it with the subdomain though would it?
    – Joshua
    Mar 6 '13 at 20:59
  • Sure. As long as that subdomain is setup by your registrar to point to your IP address at your home (or wherever you are). Your router is only aware truly of the IP and port number requested, so a different port number is still needed.
    – bispymusic
    Mar 6 '13 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .