Can a DNS server map IPs to host names?

raidermax

Honorable
Jul 1, 2013
6
0
10,510
I have one external static ip address right now and I want to run, let's say two different mine craft servers (different ports) on two different computers (one server for each computer). Rather than purchase two exterbal static IP addresses (or one static ip per compute) is there a way I could make a DNS server map internal IP addresses to host names? That way I could have multiple computers running multiple minecraft servers under the same external ip, when joining the server the fqdn of the computer would be entered rather than the ip. Is this possible?

THANKS for helping.
 
Solution
The domains are not on any machines actually. They are just entries in a big file. This is all a dns server is. It translates a string of characters into a IP address. A DNS has no concept of port numbers it only does simple translations. This is all done completely outside anything you control. You put your 2 entries into the DNS server both mapped to the same ip. After that it is the end user talking to the DNS server. The end user then sends the data to you via IP address. You have no way to tell which domain name he requested from the DNS to get your IP since both names resolve to the same ip.
Not really. If you say get 2 names name1.com and name2.com and they both map to the same external ip if a user were to open port 99 on name1.com and port 99 on name2.com they would map to the same exact internal web server. By the time the data gets to the router there are only IP addresses no names.

The only exception to this is a web server. Since the actual text url is actually in the data stream a web server/load balancer can detect these different url and map them either to different servers or at least different processes in the same server.

For mine craft you need to map directly to 2 different servers. The only way to do this is with different ports. If you are already using different ports then it does not matter if you use different DNS names.
 
It depends if you can enter the port number when connecting to a minecraft server.

You have a domain name, myminecraftserver.com that points to your static ip 12.34.56.78 if you can add port numbers to connect, then someone could connection to myminecraftserver.com:9900 and myminecraftserver.com:9901 and then your use your router to route anything incoming from port 9900 to your internal server number at say 192.168.1.111 and 9901 to 192.168.1.112
 

raidermax

Honorable
Jul 1, 2013
6
0
10,510
@bill001g so if I have two domains, domain1.com on one machine and domain2.com on another machine using the same external IP but separate ports, 25565 for one machine and 25566 for the other machine then it would work?
 
The domains are not on any machines actually. They are just entries in a big file. This is all a dns server is. It translates a string of characters into a IP address. A DNS has no concept of port numbers it only does simple translations. This is all done completely outside anything you control. You put your 2 entries into the DNS server both mapped to the same ip. After that it is the end user talking to the DNS server. The end user then sends the data to you via IP address. You have no way to tell which domain name he requested from the DNS to get your IP since both names resolve to the same ip.
 
Solution