How to point the domain name to VPS/dedicated server

I have a VPS/dedicated server which I have installed a wordpress site. I have bought a domain name from a local provider and now I need to point that domain name to my wordpress site when it is accessed from the browser. So far it can be accessed from the IP of the VPS.

The server has CentOS 7 and I have installed Virtualmin there and created a space with the name of my domain (abc.com), which is where the wordpress site is installed.

I have provided the following nameserver given by Virtualmin to my domain name provider but it does not seem to point to my server.

Virtualmin → Server Configuration → DNS Records → Type=NS-Nameserver, Value=“AB-C1234.defghij.kl56789.net.”

I am new to this and how can I fix this?

To point your domain name to your WordPress site hosted on your VPS, there are several steps you need to verify and complete. Here’s a detailed guide:

1. Understand the Process

When a user accesses your domain name, it resolves to the IP address of your VPS. This requires:

  • Correct DNS configuration at your domain registrar.
  • Correct DNS setup in Virtualmin.

2. Check Your Virtualmin DNS Records

Verify that the DNS settings in Virtualmin are correctly configured:

  1. Go to Virtualmin → Server Configuration → DNS Records.
  2. Ensure the following records exist:
  • A Record: Points your domain to the VPS’s public IP address.
@ IN A [your VPS IP]
  • NS Records: Define the nameservers.
@ IN NS AB-C1234.defghij.kl56789.net.
  • MX Records: (Optional) For mail routing.
  • CNAME Record: (Optional) For “www” to point to the root domain.
www IN CNAME abc.com.

3. Verify the Nameservers

Virtualmin generates default nameservers, but they need to be properly registered with your domain provider.

A. Get Your Server’s Nameservers

In Virtualmin, under Server Configuration → DNS Records, find the NS (nameserver) records. These are typically:

ns1.[yourdomain.com]
ns2.[yourdomain.com]

B. Register Nameservers with Your Domain Provider

  1. Log in to your domain registrar’s control panel.
  2. Locate the Custom Nameservers or Glue Records section.
  3. Add your nameservers (e.g., ns1.abc.com and ns2.abc.com).
  4. Point these to your VPS’s public IP address.

C. Update Domain DNS Settings

If you’re using your provider’s nameservers, simply update the A record to point to your VPS’s IP.

4. Ensure Your DNS Server is Running

Make sure named (BIND DNS) is running on your VPS:

  1. Check the status of BIND:
systemctl status named
  1. Start it if not running:
systemctl start named
  1. Enable it to start on boot:
systemctl enable named

5. Check Firewall and Ports

Ensure that your server’s DNS port is open to allow external queries:

  1. Check the status of ports 53 (DNS) and 80 (HTTP):
firewall-cmd --list-all
  1. Open the ports if necessary:
firewall-cmd --permanent --add-port=53/udp
firewall-cmd --permanent --add-port=53/tcp
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload

6. Test DNS Configuration

Use DNS testing tools to check if your domain resolves to the VPS:

  • Command Line: Use dig or nslookup:
dig abc.com
nslookup abc.com

7. Check Propagation

DNS changes can take up to 48 hours to propagate worldwide. Use tools like What’s My DNS to monitor propagation progress.

8. SSL Certificate

Once your domain resolves correctly, secure your site with an SSL certificate:

  1. Go to Virtualmin → Server Configuration → SSL Certificate.
  2. Use Let’s Encrypt to obtain a free certificate.

If the issue persists, let me know the exact error or behavior you’re encountering, and I’ll guide you further!