Using domain dns record (A / AAAA / CNAME &etc) to redirrect port - dns

The scenario:
I'm using a dedicated old PC to host a website from my dorm.
I have a domain that I buy from hosting provider such as 1&1, namecheap, &etc
But I have no control over router to enable port forward/trigger.
Since it's the college network.
But I'm using a VPN that allow port forward.
And I have open some port to listen, and able to access the website from internet using the open port. Eg: www.example.com:33333 or vpn_ip:33333
Apache server is set to listen to port 33333 since it's the port number that I open from VPN provider.
My question is:
How do I access the website from internet just using www.example.com. without port number at back
Is there anyway of doing it?
My idea is something like this..
I'm accessing the website using the link www.example.com (port 80)
Then,,, it is possible for domain provider to do something like forward or redirect or etc using something like A record, Cname record & etc
After it successfully forwarded port 80 to 33333. The website is accessible using port 80
Note: I know its impossible access the site using vpn_ip:80 since the vpn itself may use port 80. but how about the domain name?

Related

Why can't I use a port with my website domain name?

I have a registered domain name, www.aaaDomain.com, assigned to ip address xx.xx.xx.xx . I set up my site on IIS8 to use the ip address xx.xx.xx.xx and port 8020 for my website. I can connect to the website when I type xx.xx.xx.xx:8020 in a browser but I cannot connect to the website when I use www.aaaDomain.com:8020
Also, I have another website on this same server as my Default website. When I type just the domain name without the port number, my default website comes up (because DNS does not allow adding port numbers) just like when I type in the ip address without the port number.
What am I doing wrong?
Here is what my site binding looks like on IIS8.
As you already have an existing site running on the server you should check your security settings on both the Windows firewall and any other security/firewall settings you have - It sounds like you have not opened the additional port which you have just configured in IIS.
Check to see if you can ping the new site by its domain name - that will verify that you have the correct DNS setup, you can also try & browse to it via the server console (or remote desktop) if that works then its security setting somewhere blocking your access. Even if the ping request times out it should still resolve the name to an IP address for you to check. You may find that ICMP is also blocked.
If you just changed your dns record, be aware that you should wait up to 72 hours for the dns to replicate after changing your dns record.

AWS EC2 custom domain - subdomains and ports

I've started to get into AWS today and created a simple EC2 Instance with a Node.js app listening on port 3001.
I can access it through my public DNS at ec2-12-34-123-123.eu-central.amazonaws.com:3001 and get a Hello World output.
Not I'm trying to set up a custom domain to this instance.
I've done the following steps:
Created a domain with Route 53
Created an Elastic IP and assigned it to my EC2 Instance
Created a Hosted Zone and an A record for the Elastic IP
But still I can't access my server via mydomain.com:3001
Did I do anything wrong?
And how can I setup multiple subdomains forwarding to a specific port?
For example:
api.mydomain.com
mydomain.com
jenkins.mydomain.com
and so on, when everything is listening on another port?
Creating a record for my IP:port I get wrong value, because the ip:port syntax is not valid.
Edit:
Just did everything again.
created EC2 instance, launched node app on port 80
created elastic ip
created hosted zone for domain
registered ns on registrar for my domain
created A record for www.mydomain.xyz + alias mydomain.xyz
When I try to go to www.mydomain.xyz I only get the Gandi page with my data.
Does anyone know what I did wrong?
How long has it been since you registered the domain and created the CNAME or A record to point to your server? It can take about 24 hours for this to propagate and start resolving to your server.
Subdomains are DNS entries that point to a server. You can't forward them to a specific port, they basically point to all ports on the server. If you don't want to include a port number in the URL then you need to have something listening on the default port (port 80 for HTTP, or port 443 for HTTPS). If you need multiple web servers running on different ports on a single server, then you would need to add a reverse proxy like Nginx to that server to map the different domain names to the different ports.

Amazon EC2 - Whitelist traffic source IP for port 80 doesn't work

I have server instance on Amazon. I have domain which DNS point to Amazon server IP. I have a node.js http proxy (https://github.com/nodejitsu/node-http-proxy) which is running on port 80 and points to different apps (that run on ports like 8080, 8081) on server based on domain in request. Everything worked great.
Now I need to create whitelist of IPs which traffic can reach the server. I've edited security group on AWS in such way:
Add custom ip to port 80 (cause all domains point to this port)
Left all other ports open from anywhere
But this doesn't work.. When accessing server by domain (and by ip as well) conncection is time outed. AWS source field accepts IP in CIDR format ONLY like 93.33.40.229/32 maybe that is the problem? Or any other ideas?

How to route all traffic to a single port on google compute engine

I'm hosting a node app on the google compute engine. My app is set to listen to the port 8080. I opened up a firewall to allow tcp connections to port 8080. I can connect to my app by entering
http://<your-instance-ip>:8080
in the google chrome browser, where your-instance-ip is the external ip of the compute engine instance. I bought a domain. I want to make it so that when you enter my domain, it redirects you to this specific port. But you can only add the external ip in the A-record of my godaddy domain. How do I route all traffic to that ip, to the specific port 8080? I used nodejs with express. I want to do this using NGINX, could someone point out some tutorials?
Click on 'default' Network and Edit your "default-allow-http", make sure existing "Allowed protocols and ports" is "tcp:80" and target-tag is "http-server" also add "nodejs" in target-tag. Save your changes. Restart your google console. godaddy will listen the port 80

Not able to access website with IP adress outside VPS

I am facing problem in accessing my website from IP address with a port rather than port 80. I have a VPS and hosted a website in IIS. I created a new website and assigned port as 8080. I am able to access my website as localhost:8080/ but not able to access it through IP-Address:8080/ inside or outside VPS.
But if I host my website in default website as an application then I can access it inside or outside VPS. I am able to access it as localhost/mysitename/ and as IP-Address/mysitename/.
You must go and check your VPS firewall. You must define a rule to open tcp 8080 port on it.

Resources