Make a service listen to subdomain

Hi

Today i took the jump in to the VPS world - Got apache working with my domain with out a hitch, guides on the site is great.

But i haven't been able to find much regarding sub domains and how i get other stuff than apache listning on them.

I have some given services i would like to run of the subdomain and not the main domain.

Some example could be subversion, mysql, teamspeak.

svn.domain.com

db.domain.com

ts.domain.com

How would i do that?

It seems pretty easy to make the a records for each subdomain - but how to i tell linux that these services should run on these domains and not the main one.

2 Replies

DNS subdomains are independent of the act of listening; you do not configure a daemon to listen to a subdomain, you configure it to listen to an IP address. (Some daemon configurations accept subdomains, and will look up the address for you when they start up.)

You can add these A records to your domain and point them all at the same IP. As long as the different daemons in question listen on different ports, they can all run on the same IP address.

Does that make sense?

"Completely"

Great examples on IRC:

> [22:15:10] <@jed> all of the services on your linode listen on different ports…you can add multiple subdomains that point at the same IP address

[22:15:38] <@jed> so if my linode is 1.2.3.4, I can make git.example.com IN A 1.2.3.4, and mysql.example.com IN A 1.2.3.4, then point my clients at git.example.com and mysql.example.com

[22:15:47] <@jed> since they listen on different ports, they can coexist side by side

[22:15:58] <@jed> you are then free in the future to move mysql and update mysql.example.com to the new address

> [22:16:44] <@jed> the only downside is that if you connect to git.example.com using mysql, it'll work

[22:16:54] <@jed> since the subdomain is just an alias

[22:17:00] <@jed> (if you consider that a downside)

And thx for the super fast reply on both forum and IRC :)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct