-1

I have setup / installed webmin on Amazon Ec2 instance running linux. After creating user with login credential and adding port 10000 in security group, I am able to login via

http://IP-ADDRESS-HERE:10000

.

I would like to create subdomain like webmin.example.com which points to ip-address:10000 ( port used by webmin ). I tried to create SRV type host record on AWS Route 53 but that seems not working.

webmin.example.com. SRV 1 10 10000 IP-ADDRESS-HERE

Kindly help in this regard.

azeem
  • 103
  • 3

2 Answers2

0

You simply need to add an "A" record.

Any domain name address on a web browser by default points to port 80 http://sub.domain.com == http://sub.domain.com:80

In order to point http://sub.domain.com:80 to http://ip-address:1000, you need to setup iptables port redirection. http://www.cyberciti.biz/faq/linux-port-redirection-with-iptables

But keep in mind that then you won't be able to host a website on port 80 on the same "IP".

Please add a comment if you like me to clarify anything.

vagarwal
  • 855
  • 6
  • 8
  • Thanks for kind response. How will it do port forwarding ? If i want to point sample.example.com to ip-address then I can understand. But if I want to sample.example.com to ip-address:10000 then how can I tell to forward to that port ? Where in A record, we tell about port ? – azeem Feb 05 '14 at 12:05
  • DNS doesn't care about ports. – Drew Khoury Feb 05 '14 at 12:10
  • @DrewKhoury: So what is solution then ? – azeem Feb 05 '14 at 12:11
  • @azeem: I've updated the answer. I hope that makes sense. Please write if anything is still unclear. – vagarwal Feb 05 '14 at 12:16
  • @DrewKhoury: Thanks for downvoting. I've updated the answer. – vagarwal Feb 05 '14 at 12:17
  • @toxboi: Thanks for prompt response. Please excuse my lack of knowledge. I do have a website running on that IP address. Not being able to host website after iptables does not seem to solve the problem. If i use example.com which points to IP_ADDRESS:80 then I should be able to use website. Using subdomain should point to IP-ADDRESS:10000 so that I can access webmin to see server status etc. – azeem Feb 05 '14 at 12:22
  • @azeem: DNS A record only masks the IP address. It has nothing to do with ports. As you want to host a website on the same IP (assuming you can't add more IPs to your instance), the only way to access your Webmin management interface will be http://sub.domain.com:1000. A possible solution can be that you add another EIP to your instance (using a VPC) and let webmin listen on port 80 on that network interface. But that is too much to do just to access webmin on port 80. – vagarwal Feb 05 '14 at 12:29
0

DNS doesn't have anything to do with ports, just domains.

What you want to do is create an "A" record that points your sub domain to the right server.

Your "A" record should only have the subdomain, the fact that it's an A record, and the ip-address:

example.com.  A     192.0.2.1             ; IPv4 address for example.com

See http://en.wikipedia.org/wiki/Zone_file for more examples.

Remember:

  • DNS is in charge on getting you to the server.
  • Your server is in charge of handling the request (which includes listening and responding on the right port).
Drew Khoury
  • 4,637
  • 8
  • 27
  • 28