Why can I access a website through IP address but not by it's domain name?

21,152

Solution 1

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

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

For example:-

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

Solution 2

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: http://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.

Share:
21,152

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    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.

  • Frederik Spang
    Frederik Spang about 10 years
    Personal note: Some ISP's cache DNS records longer than 24 hours - Haven't ever heard of more than 48 though.
  • zigojacko
    zigojacko about 10 years
    This is true, some ISP's are particularly slow at updating DNS cache so in the rare event, you may have to wait longer than 24 hours. Thanks @FrederikSpang