我可以将子域配置为指向我服务器上的特定端口吗 [英] Can I configure a subdomain to point to a specific port on my server

查看:20
本文介绍了我可以将子域配置为指向我服务器上的特定端口吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台旧电脑,我将它转换成了我的世界服务器.我有 2 台 minecraft 服务器同时运行,一台在端口 25565(默认)上,一台在端口 25566 上.

I have an old computer which I converted into a minecraft server. I have 2 minecraft servers running simultaneously, one on port 25565 (default) and one on port 25566.

我购买了域 something.com 并将其指向我的服务器.现在,在游戏中输入 something.com 进入第一台服务器,输入 something.com:25566 进入另一台服务器.

I bought the domain something.com and pointed it to my server. Right now, in the game you type something.com to get into the first server and something.com:25566 to get into the other server.

有没有办法将 one.something.com 设置为指向第一台服务器,将 two.something.com 设置为指向第二台服务器?我拥有(centos)服务器,拥有 root 访问权限,以及其他一切.如果这有所不同,该域由 no-ip 控制.我知道 DNS 与端口号没有关系,但是如果我可以安装一个程序来使其工作?

Is there a way to set one.something.com to point to the first server and two.something.com to point to the second server? I own the (centos) server, have root access, and everything else. The domain is controlled by no-ip if that makes a difference. I know that DNS has no relationship to port numbers but if there a program I can install to make this work?

谢谢:)

推荐答案

如果服务器上只有一个 IP,就没有机会这样做.DNS 是一个简单的名称到数字 (IP) 解析器.如果服务器上有两个 IP,您可以将每个子域指向每个 IP 地址,并在每个 IP 的默认端口上运行两个服务器.
one.example.com -> 127.0.0.1(服务器:127.0.0.1:25565)
two.example.com -> 127.0.0.2(服务器:127.0.0.2:25565)

If you only got one IP on the server, there is no chance to do that. DNS is a simple name to number (IP) resolver. If you have two IPs on the server, you can point each subdomain to each of the IP-addresses and run both servers on the default port on each IP.
one.example.com -> 127.0.0.1 (server: 127.0.0.1:25565)
two.example.com -> 127.0.0.2 (server: 127.0.0.2:25565)

这篇关于我可以将子域配置为指向我服务器上的特定端口吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆