How to redirect DNS to different ports

后端 未结 4 1996
耶瑟儿~
耶瑟儿~ 2020-12-12 11:47

TL;DR:

DNS resolution of a domain(s) must map to IP:port(s), instead of just IP.

Example,

sub1.example.

4条回答
  •  执念已碎
    2020-12-12 12:32

    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.

提交回复
热议问题