Reizvoller
Reizvoller

Reputation: 13

Pointing domain based on port?

I was wondering if I could have a domain change where it's pointed to based upon the port the program requests. My specific need is to point a web server and a XMPP server to two different servers using the same domain.

I have example.com for web and example.com for XMPP Web uses port 80 , which I assume browsers call automatically, and XMPP uses ports 5222, 5223, 9090, and 7070 which I know is called automatically by the XMPP client I've compiled.

So from what I gather they both hit the DNS first and then get directed to IP (example) 555.555.555.555 since I currently have both web and XMPP in the same location. I want the web to hit the DNS I get pointed to 123.123.123.123 and XMPP to get 555.555.555.555 , but on the client end still just see example.com .

If what I am asking for is unclear just ask a question back and I will try to be more specific. I appreciate all your time and help on this matter!

Upvotes: 0

Views: 1243

Answers (1)

Alnitak
Alnitak

Reputation: 340055

HTTP web clients will only use port 80 (or 443 for https) by default, i.e. unless specified explicitly in the URL[*]

Any conformant XMPP (jabber) server will attempt to look up an SRV record for:

_xmpp-client._tcp.yourdomain.com

per section 3.2.1 of RFC 6120, so just create a secondary hostname for your XMPP server, and then put that hostname (and your server's port) in your SRV records.

[*] There has been discussion at the IETF about using SRV records for HTTP too, but it hasn't really got anywhere.

Upvotes: 1

Related Questions