Overclock.net banner

Subdomains and DNS

1677 Views 23 Replies 9 Participants Last post by  TheJesus
I'm trying to setup a sub-domain for my security cameras at home. I already have a domain name purchased from GoDaddy and it points to a No-IP.org domain because of my dynamic IP. The issue is that my security cameras are on port 8080 and you can't add ports to subdomains inside of GoDaddy.

An example

What I currently type: mywebsite.com:8080

What I want to type: security.mywebsite.com

The difference is I want the port, 8080, to be added automatically.

Here is what I added in godaddy:

It doesn't work, lol. I'm assuming that this is because it's DNS records and assigning ports is not valid.

What can I do here? Does anyone have any experience with this? I just want a sub-domain to point to a different port
frown.gif
See less See more
1 - 20 of 24 Posts
Could you possibly point it to a HTML document that simply redirects to the 8080 port?
  • Rep+
Reactions: 1
Hmmmmmmmmmmmmmmmmmmmmmmmmmm

That's thinking outside the box!
Quote:
Originally Posted by killabytes View Post

Hmmmmmmmmmmmmmmmmmmmmmmmmmm
That's thinking outside the box!
Lol, that's what I did to not have to deal with domain redirects.
thumb.gif
See less See more
  • Rep+
Reactions: 1
Btw you didnt blank out your domain very well? lol Also cant you just have the ip camrea website on port 80?
  • Rep+
Reactions: 1
Fixed.

Port 80 is already used.
Domains point to IP addresses or are aliases for other domains. URIs are used to point to domain/IPaddress & port combinations.

So if your domain is cameras.mydomain.com and your camera is on port 6060, you'd set the domain to your external IP address/dynamic DNS name and point your browser or other software at protocol://camera.mydomain.com:6060 where protocol is http or whatever.
  • Rep+
Reactions: 1
Quote:
Originally Posted by parityboy View Post

Domains point to IP addresses or are aliases for other domains. URIs are used to point to domain/IPaddress & port combinations.
So if your domain is cameras.mydomain.com and your camera is on port 6060, you'd set the domain to your external IP address/dynamic DNS name and point your browser or other software at protocol://camera.mydomain.com:6060 where protocol is http or whatever.
Well I was trying to avoid using ports in the domain name. The issue was that I had two servers under a single DNS entry using two different ports. 80 and 8080. I wanted to type in a subdomain to go to the 8080.
I agree that your best bet is to redirect using a html document. I thought godaddy offers this service though?

http://help.godaddy.com/article/4040#add

If not, you will want to lookup host-header routing for your particular HTTP stack and setup a sub-domain on the web server that will host the redirect file.
  • Rep+
Reactions: 1
Best bet would be to set up your PAT where you have port 80 externally open that forwards to your server on port 8080.

The 'http' prefix on a URL already instructs the browser to utilize port 80 unless otherwise specified, and is not a function of DNS.
  • Rep+
Reactions: 1
Quote:
Originally Posted by beers View Post

Best bet would be to set up your PAT where you have port 80 externally open that forwards to your server on port 8080.
The 'http' prefix on a URL already instructs the browser to utilize port 80 unless otherwise specified, and is not a function of DNS.
Damn good idea.
@OP

I agree with Imrac, it might be best to use a URI redirector, so that an incoming request for security.mydomain.com will automatically redirect to mydomain.com:8080. Make sure that port 8080 is also port forwarded, and you should be golden.
  • Rep+
Reactions: 1
Quote:
Originally Posted by parityboy View Post

@OP
I agree with Imrac, it might be best to use a URI redirector, so that an incoming request for security.mydomain.com will automatically redirect to mydomain.com:8080. Make sure that port 8080 is also port forwarded, and you should be golden.
Well GoDaddy doesn't offer parking on sub-domains, so I can't host an HTML doc with them. But I could point the sub-domain to my server with a HTML doc that re-directs...right?
Yes, you could do that. A better way might be to set up your existing web server to handle the domain/port combination so that a call to security.mydomain.com will redirect to mydomain.com:8080; it wouldn't be an HTML document as such, the server itself would send the redirect.

Make sure that ports 80 and 8080 are available from outside your network and you should be good to go. Which web server are you using?
  • Rep+
Reactions: 1
Quote:
Originally Posted by killabytes View Post

Well GoDaddy doesn't offer parking on sub-domains, so I can't host an HTML doc with them. But I could point the sub-domain to my server with a HTML doc that re-directs...right?
There are certain types of A records that will redirect to ports, and do a webhop. You may want to see how you can do that with them, then you can just make the DNS record redirect to port 8080. You can even do it in the background, so in firefox it would just show security.domain.com even though you've been redirected to a new port. Similar to a CNAME.
Quote:
Originally Posted by parityboy View Post

Yes, you could do that. A better way might be to set up your existing web server to handle the domain/port combination so that a call to security.mydomain.com will redirect to mydomain.com:8080; it wouldn't be an HTML document as such, the server itself would send the redirect.
Make sure that ports 80 and 8080 are available from outside your network and you should be good to go. Which web server are you using?
My web servers are all apache2.
Give this Apache doc a read. It explains how to use virtualhosts in Apache so you can redirect requests to different ports. Scroll down to the section "Running different sites on different ports."

I've done this successfully in IIS but never tried it in Apache. Let us know how it works out.

http://httpd.apache.org/docs/2.0/vhosts/examples.html
  • Rep+
Reactions: 1
Quote:
Originally Posted by jibesh View Post

Give this Apache doc a read. It explains how to use virtualhosts in Apache so you can redirect requests to different ports. Scroll down to the section "Running different sites on different ports."
I've done this successfully in IIS but never tried it in Apache. Let us know how it works out.
http://httpd.apache.org/docs/2.0/vhosts/examples.html
it's very easy in apache:

Code:

Code:
RewriteEngine on
rewritecond %{http_host} ^webcam.domain.com [nc]
rewriterule ^(.*)$ http://webcam.domain.com:8080/$1 [r=301,nc]
if that's dumped into the .htaccess of your main domain, then you wouldn't even need to create a vhost (of course a vhost would be tidier from a sys admin perspective)
  • Rep+
Reactions: 1
Quote:
Originally Posted by Plan9 View Post

it's very easy in apache:

Code:

Code:
RewriteEngine on
rewritecond %{http_host} ^webcam.domain.com [nc]
rewriterule ^(.*)$ http://webcam.domain.com:8080/$1 [r=301,nc]
if that's dumped into the .htaccess of your main domain, then you wouldn't even need to create a vhost (of course a vhost would be tidier from a sys admin perspective)
I already employ several Vhosts on my system. I'd prefer not to mix my site with my security camera though
tongue.gif
See less See more
Quote:
Originally Posted by killabytes View Post

I already employ several Vhosts on my system. I'd prefer not to mix my site with my security camera though
tongue.gif
So put the htaccess code I posted in a directory field on your subdomains vhost. It's doing exactly the same thing but will keep your vhost configs tidy
wink.gif
See less See more
  • Rep+
Reactions: 1
1 - 20 of 24 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top