Mobile app version of vmapp.org
Login or Join
Barnes591

: Why can I access a website through IP address but not by it's domain name? I'm using CentOS, LAMP and Wordpress.org I have added and edited a virtual host on the apache server. For servername

@Barnes591

Posted in: #Dns #Domains #IpAddress #WebHosting

I'm using CentOS, LAMP and Wordpress.org
I have added and edited a virtual host on the apache server. For servername I put the hostname that is output when I typed the command hostname. Now I'm accessing my website by typing ipaddress/wp-admin. But I want to access it through the domain name.
Doing some research I found out that I have to update my domain’s DNS records. How do I do that or is there another way to do it?

For iptables I only enabled port 80 or http access.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Barnes591

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

I am going to be rather general since there is a lot I do not know about your specific scenario.

If it just for your access, you can use the host file on your client computer. I do not do this but a friend of mine uses host files exclusively and has for more than 20 years. You can check out: en.wikipedia.org/wiki/Hosts_(file)
I use a separate internal DNS server for my work. You can install Bind or other DNS software on your web server if you are not making it public. If you are making it public, then I would use a DNS host. This is because I would not open DNS vulnerabilities on my web server if it was public.

If you already have a domain name hosted, and you want to use a sub-domain, then you can use a CNAME or A record to point to this server. If you do not have a domain name hosted, then consider registering a usable domain name (if you want to) and creating a record in a DNS host.

Each DNS host has a different interface so I cannot get too specific on this. I have not kept up with these too much.

If the server is not to be public, make sure you are using a non-routable IP address such as 10.0.0.100 to help keep it private.

10% popularity Vote Up Vote Down


 

@Harper822

You'll need to create an A record to point the domain to the servers IP address.


Log in to your domain registrar control panel or wherever your DNS records are controlled.
Create a new A record.
Set the domain.com. as the host and the value as the IP address.
Allow up to 24 hours for the DNS record to propagate.


For example:-


Host: clubnetsem.com.
Type: A
Value: 149.255.56.109

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme