I want to connect my domain to my localhost server to be accessed remotely (not only on localhost). I have a static IP address available. When I type my static IP address into the browser from a remote network, it works fine. How do I connect a domain? Do I just put my static IP address as the nameserver?
1 Answer
No. The purpose of the nameserver is to serve DNS records. You could of course run your own nameserver (e.g. using nsd
or bind9
), but if your domain registrar offers their own, you should probably use that for now.
Instead, you need to change those DNS records to have your main server's IP address. If your domain uses the registrar's nameservers, they'll usually have a web-based control panel for that.
Specifically, you need to create or change the A
(IPv4 address) type record under the main domain name – which is sometimes listed as @
in the control panel.
(If you also want a "www.mydomain" subdomain, also add it the same way. It's not automatic.)
Overall it should look like this:
NAME TTL TYPE VALUE
---- --- ---- -------
@ ... A 1.2.3.4
www ... A 1.2.3.4