specify port with dns in google domains - google-domains

I have a web server and a minecraft server and I need to set my minecraft servers subdomain on the same network as the web server so I need dns to do this:
mc.mydomain.net => myip:25565
www.mydomain.net => myip:80
My mc srv record looks like this "0 0 25565 myip".
Now I have the last thing working, but the minecraft server does not work.
I also tried using a srv record but that failed.

Related

Make Minecraft server IP the same domain as the website

I am trying to figure out how I can make the IP of a Minecraft server the same as the website (two different servers: a Minecraft server host and a VPS for the website.) I am trying to do this without any subdomains. I've seen other Minecraft servers do this before, I just don't know how.
Some servers that do this:
quantum-mc.net
theseedmc.com
partyrealms.com
Since your Minecraft server and your website have different IP addresses, they also need different hostnames. You can, however, set up the SRV records such that the person connecting to you just needs to type in your main URL.
Let's say your domain is example.com, your website is at 192.0.2.1 and your Minecraft server is at 203.0.113.1.
You most likely already have an A record for your website, something like
example.com. A 192.0.2.1
You will need another A record for your Minecraft server. Let's call it mc.example.com:
mc.example.com. A 203.0.113.1
Now you create a SRV record that tells the Minecraft client connecting to example.com where to actually find the server:
_minecraft._tcp.example.com. SRV 0 25565 mc.example.com
This tells the client to connect to mc.example.com on port 25565 with a weight of 0.

Why does my vps reply to dns queries even if it has no dns server running?

I've got a cheap openvz Ubuntu vps and i'm trying to run my own dns server on it for learning purpose.
The dns server works fine in localhost (on the vps through ssh), i can query it using dig google.com #127.0.0.1 and i get the expected result (which is not the IP of google.com but a custom one).
When i try to query the dns server from outside the vps, using the same command, I do get a reply but the IP is not what I expect (it's an actual google.com IP).
After further investigation I found out my dns server is not receiving/sending packets when the query is done from outside the vps. So the answer is sent by something else, it seems like inbound packets with destination port 53 are deviated, they do not even reach my dns server.
I tried to query my dns server, still from outside, but this time while the VPS was SHUTDOWN. Magically i got a reply from god knows who.
Changing port from 53 to 54 everything works perfectly.
The problem is i need it to use port 53.
I don't have iptables rules nor any other firewall doing something related to port 53
I also tried to query some other random vps, from different hosting providers, seems like everyone has a dns server running! Why does everyone reply?
Of course i asked technical support, that's what they said:
Hello,
Sorry but we don't do "software" technical support on VPS.
We deliver the hosting and the operating systems, customers that order VPS are their own admins, and have to know how to manage a linux server.
We don't block any port on our side.
Best regards,
Support
Mybe your dns server is bound to the loopback interface only (so it's only listening on localhost). You can check the current service ports used (udp for DNS) using netstat and filter (grep) udp port used
netstat -an | grep ":53"
Also you can test the same dns query using the nslookup command, and checking the dns server ip that answer your dns query, in the result output:
nslookup google.com [dns_server_ip]
Also test it without dns_server_ip to check if there is a default nameserver when the specified nameserver is not responding.
Problem solved, it's my ISP intercepting and replying to dns queries.
I can do dig google.com #1.2.3.4 and i get a reply :D
Who wants to know more about this:
ISP Intercepting DNS Lookups

Every subdomain redirect to main one

I have bought VPS server and domain that points to IP of that vps. I thought everything was working fine however i noticed that when i ping:
ping domain.com
ping asd.domain.com
ping asd.asd.asd.asd.domain.com
it gives always same result (pings my vps) and i guess it shouldn't do that (only domain.com). I'm using Ubuntu 16 on vps without any special configuration. So do i need to set up dns server or something on my server? Is this natural behaviour? How to "fix" this and how to manage subdomains?

point node js app to domain

I want to point a domain to the nodejs app running on 3000 port.
Currently my app is hosted on aws. If I have to point my domain to the app, so that I don't have to write <domain>:<port_number> in browser then I think I have two options:
use nginx to proxy the request to port 3000
use aws route 53 for the same
Correct me if I'm wrong and please suggest which one should I opt
Route 53 is just a Domain Name Server.
If you fire up a EC2 instance, you can reach it with the IP address. In addition you get a generic domain to connect to your EC2 instance, something like this: ec2-xx-xxx-xxx-xxx.eu-west-1.compute.amazonaws.com
This is ok for testing, but not for a production setup.
So if you want to point a more pleasant domain name to your instance, you need to edit the dns record on your DNS Server. For this you can use Route 53 or any other DNS Service like namecheap or iwantmyname.com.
You can't configure ports there, so use option 1 and set up nginx.
Of cause, as option 3 you can change the port of your nodejs app to port 80, but then you need to run it as root user and that is really bad practice!
So stick with nginx.
More about DNS: https://en.wikipedia.org/wiki/Domain_Name_System

AWS redirect URL with AngularJS running in Node.js server

I´m trying to config a website hosted in AWS EC2 instance. But Im a bit mixed!!
I have an AngularJS application running in a Node.js server listening on port 1234. This site is deployed correctly, so when I get the url in a browser ec2-instance-public-dns:1234/app/index.html I see my site perfectly.
In the other hand, I registered a domain name in GoDaddy. I set up a Route 53 and the DNS names in GoDaddy.
I see, I also have a load balancer listening in port 80, that is redirecting to port 1234.
What I need is to link my domain with my site in the path ec2-instance-public-dns:1234/app/index.html
All this stuff is not working. How can I achieve this?
Is there is reason why you don't have Node listen to 80 or 8080 ?
Does the DNS redirection work ? -> Can you access your site with www.yourdomainname.com:1234 ?
-> If no, then check your dns config, you should not have to deal with port routing at that level.
Are you using Linux as your EC2 instance ? If yes, reroute port 80 toward port 1234 as explained here (http://www.cyberciti.biz/faq/linux-port-redirection-with-iptables/).
That how I do it, hope that helps.

Resources