How to host a website locally but with .com domain and accessible on internet - dns

I've bought a .com domain from a provider on the internet. But, I want to host it locally.
I know that I can host a local web by using XAMPP or WAMP, but I want to make it accessible on the internet.
I also know that we could host a web to be accessible on the internet like ngrok, serveo, etc.
But, I want it with my .com domain that I bought. Could this possible? How to? Is there any references?
Thanks in advance ^_^

It seems to me you are asking 1. if it is possible to map a DNS entry such that traffic to the URL would be directed to a server in your personal network, and 2. if it is possible, how to do it.
The answer to the first question is yes, it is possible. The second question is difficult to answer because it depends on many factors such as your ISP, country, your web host provider's rules and services, etc.
First, you must determine two IP addresses:
The public IP address for your network (whatismyip.com)
The private IP address of the local machine which will host your website (typically (192.168.0.x)
Then, you must enable port forwarding in your router configuration, such that any requests to port 80 and/or port 443 on the external interface (public) will be forwarded to the internal port on which your website is hosted. If done properly, putting the public IP in your browser will take you to the website you are hosting locally.
Once you verify access via public IP, then you must go into your DNS entries on your domain host and create a CNAME record which points your root domain (www.yourwebsite.com) to your public IP address. That will route all traffic to your .com to your local server.
I do NOT recommend doing this however, and would caution against it, because it leaves your local server/network open to the public, and makes your domain vulnerable to things such as spoofing etc. To do it properly, you should obtain a security certificate for your domain through a Certificate Authority (CA) - generally, you can request a certificate via your domain hosting service. Once you have a certificate, you must upload the key to your server and configure your web application/hosting service to use the certificate, and then change your port forwarding to use 443 instead.
This is a very complex topic that takes time to learn, and your question is extremely non-specific. There is no good place to start really, and no shortage of information/resources available online. To start, you need to understand how your DNS works. For any local webhosting, port forwarding is important to learn. You should also determine if your ISP blocks the forwarding of certain external ports, which effectively disables any private webhosting.

Related

Nodejs - What does it actually means to deploy a website on a domain and how to do it?

I am a bit new to the deployment of a website. I have a server which is written in Node.js. Previously I had been using Heroku for deploying my apps without knowing much about deployment. I would like to know how do I deploy my server to create a website which has .com at the end of it like www.example.com and not www.example.herokuapp.com. I think it has something to do with domains (correct me if I am wrong). I would like to know what exactly is a domain and a DNS provider and how to deploy a website in such a way. Thank you.
You should ask one question to yourself when you hit www.example.com in browser how does it load a page?. When you run a website on your laptop it basically runs locally, if you want to access your website over the internet you would require public IP(host or server) accessible over the internet so you can access a webpage using public IP:port. But this is not the best option because IP may change in the future and also remembering IP for each application will be difficult. Imagine if you access Facebook, Instagram or any other websites by its IP addresses how difficult and inconvenient would it be? There are a couple of things you should know.
DNS-> Domain Name system
Every host is identified by the IP address but remembering numbers is
very difficult for the people and also the IP addresses are not static
therefore, a mapping is required to change the domain name to IP
address. So DNS is used to convert the domain name of the websites to
their numerical IP address.
DNS is a hostname to IP address translation service. DNS is a distributed database implemented in a hierarchy of name servers. It is an application layer protocol for message exchange between clients and servers.
Name servers
Domain Name Servers (DNS) are the Internet's equivalent of a phone book. They maintain a directory of domain names and translate them to Internet Protocol (IP) addresses. This is necessary because, although domain names are easy for people to remember, computers or machines, access websites based on IP addresses.
DNS record
A domain name, IP address what is the validity?? what is the time to live ?? and all the information related to that domain name.
Once you understand the DNS
Host(Deploy) your website to Amazon EC2 or Heroku and obtain Public IP.
Buy a domain from domain provider like Godaddy
Map domain(ie www.example.com to IP)-> DNS record
Mapping domain to IP may vary platform to platform but the Core principle remains the same. I would suggest you these below link. Try to find differences in both, doing so you will learn along the way
http://www.littlebigextra.com/map-domain-name-amazon-aws-ec2-instance/
https://medium.com/progress-on-ios-development/connecting-an-ec2-instance-with-a-godaddy-domain-e74ff190c233

Website in IIS locally and Domain Name bought from GoDaddy - What Next

I have been at this since last couple of weeks. After tiring efforts leading to nowhere, I am posting here.
I have a Website built and hosted in IIS locally. I just bought domain name from GoDaddy. I have my computer's public IP where the website in IIS is present. What are my next steps so that I can keep my computer as server and link with domain name? So that website is accessible publicly through domain name.
I saw a lot of posts with Web Hosting in Azure or other places, do I HAVE TO buy and host to make my site public?
I am a novice website builder and have very limited knowledge about this.
first you need make sure your sever is secured, only open necessary ports
go to another computer, in browser input public ip to see if you can open your webpage
then in Godaddy you can add A record for your domain, to point your domain to your public IP, refer to this GoDaddy document: https://ca.godaddy.com/help/add-an-a-record-19238
If you are not comfortable or don't resource to do these, I suggest you host on Azure or other cloud providers
You could host your application in either Azure VM or your local machine. After all, Could VM should be more convenient because you don't need spend a lot of time to handle network issue and you don't need physical space.
When you decide to host your application locally, you have to ensure your are using windows server OS, otherwise, you have 10 concurrent request limit.
Access the application via domain is quite simple.
You need to enable port like 80 in windows firewall.Promise your server are in DMZ and can be accessed externally
Create IIS binding header with null domain and your public address
Try to access your website via your public IP address
Point godday domain to your public IP address
Add your domain to your Site's binding host header->host name field
If you decide to host your application in IAAS like Azure VM, then you have to create inbound rule for your port number and allow port in windows firewall. You also have to point your godday domain to your cloud VM's public IP address and create IIS binding with your domain. Finally, you should be able to access your website.

Hosting Website LIVE on the domain I've bought

I'll get straight to the point.
I have bought a domain. I want to host it on my computer, maybe on a raspberry pi since only 50 persons/month will visit it.
Anywhere I've looked I see two hosting methods, using IIS/WAMP/XAMPP to only create a localhost website or adding the domain to C:\Windows\System32\drivers\etc\hosts.txt that is also... localhost.
What is the magic answer here? How can I host LIVE a website with the domain that I have bought? Am I stuck to using a hosting service? Am I missing something really important?
using IIS/WAMP/XAMPP to only create a localhost website
You need an HTTP server if you want to host a website. It needs to run on the computer you want to host the website from.
adding the domain to C:\Windows\System32\drivers\etc\hosts.txt
That's what you do as a poor man's solution instead of buying a domain name.
The Domain Name needs to be associated with a DNS server (and secondary DNS server) by your registrar.
Usually, a registrar will provide DNS hosting services as part of the deal.
The DNS server needs an A record pointing at the IP address of the computer running the web server. This IP address needs to be available to whomever is going to visit it (which almost certainly needs to be public facing) and should be static (unless you want to play games with very short TTL values and frequent reconfiguration of the DNS servers).
If you plan to host multiple different websites on the same server, you'll probably want to configure the HTTP server software to handle Virtual Name Hosting (whereby it pays attention to the Host header in the request and dynamically serves different content based on it)

how to point from a subdomain to a dedicated ip in my home isp account

i need to point from my hosting account to my local server
so i thought the best way is to do it using a subdomain
though the issue is that i cant figure which is the right way to do it
using same DNS as my domain / leaving it blank
using my internet isp dns maybe ?
what is the right way to point a subdomain to a static ip of my isp internet account at home ?
You don't need a subdomain, you need an A record (address). You could set up a subdomain, and then use an A record within that, so, if your domain is example.com:
Your domain is set up as example.com, your public web server A record might be www.example.com. You could then set up your home server A record as homeserver.example.com
A sub domain might be 'home.example.com`, and a server in the sub domain will have an A record of myserver.home.example.com.
In all these cases the IP address of your A record should be the IP address of the network side (external side) of your home internet router. If the address is static this will work, but if it's not you'll need to subscribe to a DNS service that supports Dynamic DNS, and that's a whole different story.
How you go about setting all this up is ISP-dependent.
Note that the external address of your network will not match the internal address of your server, so you'll need to set up port-mapping on the router to allow inbound traffic to reach your server.
..and lastly, do you really want to risk opening up your home network to the ravages of the public internet? Do this only if you really know what you're doing, and possibly not even then.

DNS not resolving outside intranet

We are installing a security camera system in our company which comes with a DVR that hosts a website on which you can view the cameras via the web.
I have setup the DVR with a static IP of 192.168.120.199 on our network and can view the website while on our network (either when at work or logged in via VPN). The camera DVR uses port 80 for viewing the webpage and port 9000 for Media Port.
We use GoDaddy to host our DNS info and I have added an Host(A) record of 'cameras' that points to the address of our server. I have also added a forward lookup Host(A) to our domain's DNS manager of 'cameras' that points to 192.168.120.199. When I use the address 'cameras.mysite.com' within our domain the website displays properly, but when I try the same address from outside our domain (ie, at home) it displays the default IIS 7 page (from our domain server).
Two questions about this setup:
Why does the forward lookup work when inside our domain but not outside (why does it go to the IIS default page when outside the network)?
How do I get this to forward correctly if not via the forward lookup host?
Because internally you're looking it up on your internal DNS server and you get the right 192.168.x.x machine. When you look it up externally GoDaddy is giving you back the 192.168.x.x, but that's not a publicly routable IP, so doesn't go anywhere. If you really want to be able to connect to your security cameras from outside your facility then I suggest setting up a VPN for security reasons. But if you want GoDaddy to directly route to your internal machine from the public internet then you'll have to give it a publicly routable IP.
As a further note on that - 10.x.x.x, 192.168.x.x and 172.16-31.255.255 are not publicly routable. They're called private IP blocks.

Resources