Using a VPS as a DNS Server to Point it to itself - dns

I recently purchased a VPS and I got a free domain (.tk). Now, I wanted to create a domain name server on my VPS, for the .tk domain; this DNS Server should point it to itself.
I followed this URL but in vain. It does not work. How do I setup my VPS so that whenever I enter myname.tk in a browser it resolved to my VPS' IP address and renders the pages?

Related

How to point external domain to VPS server

I have a Bluehost VPS account and I need to point my external domain which is purchased from porkbun to my VPS server. After some research, I have changed the A record in the domain registrar to my VPS server IP and changed name servers to Bluehost servers(which are ns1.bluehost.com and ns2.bluehost.com). Currently, when accessing the domain I'm seeing the default Bluehost page, but it does not seem to be connected with the server as it does not display any file I'm updating in the root folder. Is there any step I'm missing? I have tried changing nameservers of the VPS server itself by editing DNS settings in the domain, but any of them does not seem to be working. Any help on this would be highly appreciated.
If you are trying to 'browse' to your VPS server then you would need to add an 'A' record type into the DNS for the domain name.
For example, if you are browsing to 'test.mydomain.com' and your VPS IP Address is '192.186.1.15' then you should add an A Record into the domain zone file with the following detals:
Host Record - test
Points To - 192.168.1.15
These details are taken from the following page:
https://www.bluehost.com/help/article/dns-management-add-edit-or-delete-dns-entries#add

Connecting my domain name on digital ocean droplet

I created a small hello world node app, then i hosted the app on digital ocean droplet, after that i can access my application on http://my_public_ip:3000
Felt happy 😍
Then i bought a domain name called helloworld.tk free domain from freenom.com
After that i install nginx as a webserver in my droplet then i added a reverse proxy code in /etc/nginx/sites-enable/default
My code looks like:
server {
listen 80;
server_name helloworld.tk
location / {
proxy_pass http://localhost:3000;
}
}
After that i went to domain management panel in my freenom.com and set url forwarding to http://my_public_ip
So if i enter my domain name helloworld.tk in browser my node app successfully works 🤩 but wait what 🤔 my ip address is showing on left side below corner on chrome and if i refresh the page multiple times i get
402 Too many request error page on nginx
So i deleted my url forwarding and in my domain management panel instead of url forwarding i set my nameservers like this ns1.digitalocean.com bla.bla.bla...
Then i added my domain in my digitalocean panel. Now yes everything is working perfect.
If i hit my url no ip address is showing, also no too many request errors 😌
My node app successfully getting executed!
Wait i am a beginner for hosting node app, so i need help whether it is correct good setup for nodeapp on production?
What is the difference between url forwarding and nameservers? Whether my nginx reverse proxy code is correct? is my reverse proxy working correctly?
NOTE: I used pm2 for running node app on background.
First, remove the forwarding and you need to change the nameservers of the domain in your domain DNS management if your domain is somewhere other than DigitalOcean
Add below nameservers:
ns1.digitalocean.com
ns2.digitalocean.com
ns3.digitalocean.com
Now check if they are propagating by using whatsmydns.net (Enter your IP and change click on A and select NS and click Search)
Once they are propagating, add the domain to your DigitalOcean account.
Go to your DigitalOcean Dashboard and click on Networking.
Add a domain and click Save.
Then Edit the domain and add the Droplet to the Domain and save.
Now click on the domain name and an A record which points to your droplet.
Hope this will resolve your issue.
Go back to your DNS domain registrar ( freenom.com ) and remove mention of digitalocean nameservers and put back its own default frenom.com nameservers ... also on freenom.com assure you have defined a Type A record to point to your machine's external IP address
Your nginx config looks OK
this should work ... now had you defined digitalocean nameservers in your freecon.com registrar you would have then needed to go to https://cloud.digitalocean.com/networking/ and set up your Type A record there ... its critical to know the location of your nameservers determines where your Type A record must live
What you have to do is create a droplet in DigitalOcean and then add your domain name to the droplet in the Networking tab. You have to add both the non-www and www versions so the domain will be pointed correctly. You have to set the A records for those two to the IP of the droplet that DigitalOcean assigned to it.
Then from your GoDaddy/your domain manager, you have to go to ManageDNS and change the default GoDaddy name servers with those of DigitalOcean. Save it and you are done.
Wait for up to 24 hours and test the domain with check-host.net If all done correctly the domain should point to the servers of DigitalOcean in the city you have selected.

Domain not attached to the Cpanel

I registered domain on the WHM and create a new user cpanel with the domain, the domain is added to the cpanel. But when i try to browse the domain name it getting server DNS address could not be found.i updated the name servers with my server name, but nothing changed.
when i try to go through myip/~newuser it going fine to the site file, but with the domain name it's not.
You have a DNS issue in this case. Please check your DNS zone with a tool like intoDns:
https://intodns.com/yourdomain.tld
See if you get any errors there. If you do, then you have issues with your DNS configuration. Be sure that you have create the parent DNS servers for your domain if you want to use the DNS from WHM (the parent DNS servers should point to your WHM server ip).
Try using external services to query your DNS server to see if it actually works (like MXToolBox etc). Or you can use nslookup or dig right from your WHM server by connecting via ssh.

How can I access files on a remote server from a vpn with same web addess

I am hosting a web app on a Digital Ocean VPN. I set up an A record via GoDaddy to point my domain to the VPN server. I'm wondering if there is a way to still access public files from within the web app that I have on GoDaddy shared hosting at that same address.
I basically want to access a file at http://example.com/uploads/somedoc.pdf
Which would be at the following path on the GoDaddy server:
home/site/public_html/uploads/...
But example.com now points to the VPN. I tried using the GoDaddy website IP address instead in the URL but that doesn't work either. I get a 404 file not found error even though the files are actually in the uploads folder. I figure it's looking for them on the VPN instead.
In case anyone else runs into this problem I solved my issue by simply adding an A Record for a subdomain in my DNS zone file and I was able to point my VPN server IP to that subdomain. So with my web app being served at app.example.com I was successfully able to access the files on the GoDaddy shared server from my web app (ie example.com/uploads/somefile.docx).
To ensure that the client would still visit the web app at the new subdomain I setup a permanent redirect to send all traffic from example.com to app.example.com instead of them having to remember to type the subdomain each time they want to access the web app.

Team City 9.1.3 and IIS 8.5 Win2k12 r2 URL Rewrite

I've successfully installed Team City 9.1.3 on a Win2k12 R2 server. I can get to TC by going to http://localhost:8080 - all works as it should and no issues.
However, I would like to access TC from any browser within my company. I don't want to remote desktop just to get to TC, so I followed the instructions Here, but I cannot get to TC through my domain. My domain is http://teamcity and is bound to a 10.* ip address since I don't want it public. I do get a reply when I ping "teamcity." Should it be a public ip?
The server is a fresh VM I created yesterday and there are no other sites on it. The server is on the domain and I can remote desktop into it.
Is there anything I need to do to associate http://teamcity or the ip address with the server?
As a test, I associated the default web site in iis with the new domain and ip address. If I navigate to either the ip address or the domain in a browser on the server, it does not take me to the default web site. Nor does that work if I do the same from my desktop.
Any help would be greatly appreciated.
Update:
Sys Admin fixed the issue. The ip was not bound to the server. As soon as he fixed that issue, everything is working as it should now.

Resources