Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

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.

share|improve this answer
    
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 5 at 12:05
    
DNS doesn't care about ports. –  Drew Khoury Feb 5 at 12:10
    
@DrewKhoury: So what is solution then ? –  azeem Feb 5 at 12:11
    
@azeem: I've updated the answer. I hope that makes sense. Please write if anything is still unclear. –  toxboi Feb 5 at 12:16
    
@DrewKhoury: Thanks for downvoting. I've updated the answer. –  toxboi Feb 5 at 12:17

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).
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.