I have a registered domain (eg: www.mydom.example), a public IP and Server 2019. I need to set up my server in order to host my own website. I can currently browse my website externally via my public IP and this works fine.
I need help with linking my domain name (eg: www.mydom.example) to my server so that I can access the site using my domain name (eg: www.mydom.example).

I tried a few tutorials on how to configure DNS on the server, but I can't seem to find anything that works. I know I need to set up nameservers and A records and then get my domain to point to the server, but when I follow the tutorials on how to set the server all seem to be for internal networks.

Are there any tutorials or guides on how to go about doing this?


Solution 1:

Who are you using to register your domain name? Some registrars have the option to serve DNS records.

If your domain registration provider doesn't provide DNS functionality, you'll have to either setup your own DNS servers (you want two for primary and secondary/backup) or find a DNS service provider. Your DNS registrar should allow you to specify name servers within their web portal. You want to point those two name server records to your DNS provider.

Then within your DNS provider, specify A records for your domain to point to your IP address (or AAAA records for IPv6 addresses).

Domain registrar -> DNS Server -> A records for example.com -> IP of your server

So to recap: there are three major pieces:

  1. Domain Registration
  2. DNS Service
  3. Web site or other Internet Service

You seem to have 1 and 3. You just need to setup your DNS records by finding a DNS service provider for 2. You then tell your domain registration provider to use that DNS server, and tell that DNS server to point to your web server.