如何将DNS重定向到不同的端口 [英] How to redirect DNS to different ports

查看:422
本文介绍了如何将DNS重定向到不同的端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我拥有域名Arboristal.com,我知道我的标题听起来很愚蠢,但这是一个合法的问题。我也在arboristal.com上私有所有子域。例如lg.arboristal或ft.arboristal.com。



在我的DNS设置下,Arboristal.com将设置到我们正在托管我们网站的网站主持人。



我有三台服务器在我家运行,全部运行在一个公共IP地址下。 (71.82.237.27)



我还有三个子域名Arboristal.com指向我的IP地址。



这三个服务器中的每个服务器都在自己的端口上运行(25565,25566,25567)



我希望每个子域都指向我的IP地址上的每个打开的端口。 p>

不幸的是,当您尝试使用其中一个子域连接到其中一个服务器时,它仅连接到您键入端口的服务器。



我的情况:



三个服务器,每个服务器在不同的端口上运行。 (所有端口和作为服务器)



Minecraft服务器一(25565)



Minecraft服务器二(25566)



Minecraft服务器三(25567)



我的DNS提供商(webs.com)上运行了三个子域名



mc.arboristal.com



tekkit.arboristal.com



pvp.artboristal.com



当您使用Minecraft连接到其中之一时,它会通过端口25565自动执行,这意味着无论您尝试什么URL连接到它总是通过端口25565连接到我的IP。将您连接到Minecraft服务器。您可以手动输入端口,但我宁可保持尽可能好看和专业。



所以,现在你知道我的情况,是否有任何可能的方式,我可以使mc.arboristal.com,tekkit.arboristal.com和pvp.arboristal.com所有这些都在不同的端口上转到我的IP地址,而不必在用户端指定提供的URL中连接的每个端口?



我可以添加MX,A这个连接到服务器),CNAME和TXT记录到DNS设置



如果我需要使用第三方,我也可以将名称服务器添加到DNS设置我的DNS提供商(如果需要,我愿意做)



如果有任何需要配置的话,我也可以在192.168.0.1上完全访问我的路由器。



我刚刚了解到互联网在上周真正发挥作用,所以我不确定这里是否有实际可行。我也可能没有关于互联网实际工作的正确信息。请原谅我有关互联网的任何虚假信息。



提前感谢你的时间,我希望我的问题不会太混乱/难以回答。

解决方案

您可以使用 SRV记录

  _service._proto.name。 TTL类SRV优先权重端口目标。 




服务:所需的服务。



Proto:所需服务的传输协议;这通常是TCP或UDP。



名称:此记录有效的域名,以点结尾。 >

TTL:标准DNS时间到现场。



类: strong>标准DNS类字段(这一直是IN)。



优先级:目标主机的优先级,较低的值意味着更优先。



重量:具有相同优先级的记录的相对权重。



strong>端口:要查找服务的TCP或UDP端口。



目标:该机器提供服务,以点结尾。


示例:

  _sip._tcp.example.com。 86400 IN SRV 0 5 5060 sipserver.example.com。 

所以我想你要找的是将这样的东西添加到你的 DNS主机文件

  _sip。 _tcp.arboristal.com。 86400 IN SRV 10 40 25565 mc.arboristal.com。 
_sip._tcp.arboristal.com。 86400 IN SRV 10 30 25566 tekkit.arboristal.com。
_sip._tcp.arboristal.com。 86400 IN SRV 10 30 25567 pvp.arboristal.com。

在附注中,我强烈建议您与托管公司搭档,而不是自己托管服务器。这只是要求您的家庭连接(DDoS和带宽/连接速度)的麻烦,但由您决定。


Hello everyone I know my title sounds stupid but it is a legitimate question and I will explain my position entirely.

I own the domain "Arboristal.com". I also own all sub domains privately on arboristal.com. Such as lg.arboristal or ft.arboristal.com.

Under my DNS settings, Arboristal.com is set to go to our web host who is currently hosting our website.

I have three servers running at my house all running under one public IP address. (71.82.237.27)

I also have three subdomains of Arboristal.com pointing towards my IP address.

Each of the three servers run on their own ports (25565, 25566, 25567)

I want for each subdomain to point to each open port on my IP Address.

Unfortunately when you try to connect to one of these servers using one of the subdomains it only connects to the server that you type the port for.

My situation:

Three servers, each running on a different port. (All portforwarded and working as servers)

Minecraft server one (25565)

Minecraft server two (25566)

Minecraft server three (25567)

I have three subdomains running on my DNS provider (webs.com)

mc.arboristal.com

tekkit.arboristal.com

pvp.artboristal.com

When you use Minecraft to connect to one of these it does automatically through port 25565, meaning that no matter what URL you attempt to connect to it always goes to my IP with the port 25565. Connecting you to Minecraft server one. You CAN type in the port manually, but I would rather keep this as good looking and professional as possible.

So, now that you know my situation, is there any possible way I can make mc.arboristal.com, tekkit.arboristal.com, and pvp.arboristal.com all go to my IP address under different ports without having to specify each port in the provided URL to connect to on the users end?

I can add MX, A (Using this one to connect to the server), CNAME, and TXT records to DNS settings

I can also add Name Servers to DNS settings if I need to use a third party as my DNS provider. (Am willing to do if necessary)

I also have full access to my router at 192.168.0.1 if anything needs to be configured there.

I have only just learned how the internet really functions in the last week so I am unsure if anything here is actually possible. I also may not have the right information about how the internet actually works. Please forgive me for any false information that I may assume about the internet.

Thanks in advance for your time, I hope my question is not too confusing/difficult to answer.

解决方案

You can use SRV records:

_service._proto.name. TTL class SRV priority weight port target.

Service: the symbolic name of the desired service.

Proto: the transport protocol of the desired service; this is usually either TCP or UDP.

Name: the domain name for which this record is valid, ending in a dot.

TTL: standard DNS time to live field.

Class: standard DNS class field (this is always IN).

Priority: the priority of the target host, lower value means more preferred.

Weight: A relative weight for records with the same priority.

Port: the TCP or UDP port on which the service is to be found.

Target: the canonical hostname of the machine providing the service, ending in a dot.

Example:

_sip._tcp.example.com. 86400 IN SRV 0 5 5060 sipserver.example.com.

So what I think you're looking for is to add something like this to your DNS hosts file:

_sip._tcp.arboristal.com. 86400 IN SRV 10 40 25565 mc.arboristal.com.
_sip._tcp.arboristal.com. 86400 IN SRV 10 30 25566 tekkit.arboristal.com.
_sip._tcp.arboristal.com. 86400 IN SRV 10 30 25567 pvp.arboristal.com.

On a side note, I highly recommend you go with a hosting company rather than hosting the servers yourself. It's just asking for trouble with your home connection (DDoS and Bandwidth/Connection Speed), but it's up to you.

这篇关于如何将DNS重定向到不同的端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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