Can't access WHM through hostname

Operating System & Version
CentOS 7
cPanel & WHM Version
88.06

QueasyTiger

Member
Jun 3, 2020
5
0
1
Scarborough, England
cPanel Access Level
DataCenter Provider
Hiya.

So, I can access my WHM when I use the ip, but not the hostname. I get the NXDOMAIN error in my browser, and it doesn't resolve to the IP.
All of my A records are there, and my DNS resolver is 1.1.1.1, and 1.0.0.1.

I can't access any of the cPanel sites via their domains either, and the nameservers are set to my own with the registrar.
I have no clue what's going on!
Just ask for more info, screenshots etc.
 

QueasyTiger

Member
Jun 3, 2020
5
0
1
Scarborough, England
cPanel Access Level
DataCenter Provider
This sounds like a DNS issue, which nameserver are you using on the server and can you confirm the hostname has an A record in the root domain's DNS zone file?
Hi, sorry for the late reply.
My nameservers are ns1.domain.tld and ns2.domain.tld. I'm using a free domain temporarily to test my ideas for my internet services business. Could that be the cause of my issues?
My DNS Zones are attached.

I can also confirm that all the appropriate ports have been forwarded.

I'm kinda stumped.

Thanks!

[Moderator note: removed actual domain name from this post.]
 
Last edited by a moderator:

cPSamuelM

Technical Analyst Team Lead
Staff member
Nov 20, 2019
196
38
103
USA
cPanel Access Level
Root Administrator
Hello @QueasyTiger

Thanks for providing the screenshot. I am redacting the screenshot so as not to expose your domain name.

When performing a DNS query for your domain's A record with the dig utility and its trace option, I received the following result:

Code:
$ dig domain.tld A +trace

[..]

domain.tld.        300    IN    NS    ns1.domain.tld.
domain.tld.        300    IN    NS    ns2.domain.tld.
couldn't get address for 'ns1.domain.tld': not found
couldn't get address for 'ns2.domain.tld': not found
dig: couldn't get address for 'ns1.domain.tld': no more

This indicates that the name servers do not have IP addresses assigned to them at the registrar. I recommend you refer to the following page from our documentation with instructions for configuring custom name servers to work properly with cPanel:

https://docs.cpanel.net/knowledge-base/dns/how-to-set-up-nameservers-in-a-cpanel-environment/

Best regards
 

QueasyTiger

Member
Jun 3, 2020
5
0
1
Scarborough, England
cPanel Access Level
DataCenter Provider
Hello @QueasyTiger

Thanks for providing the screenshot. I am redacting the screenshot so as not to expose your domain name.

When performing a DNS query for your domain's A record with the dig utility and its trace option, I received the following result:

Code:
$ dig domain.tld A +trace

[..]

domain.tld.        300    IN    NS    ns1.domain.tld.
domain.tld.        300    IN    NS    ns2.domain.tld.
couldn't get address for 'ns1.domain.tld': not found
couldn't get address for 'ns2.domain.tld': not found
dig: couldn't get address for 'ns1.domain.tld': no more

This indicates that the name servers do not have IP addresses assigned to them at the registrar. I recommend you refer to the following page from our documentation with instructions for configuring custom name servers to work properly with cPanel:

https://docs.cpanel.net/knowledge-base/dns/how-to-set-up-nameservers-in-a-cpanel-environment/

Best regards
Hi, sorry, I'm very new to this. I've only ever played with my cPanel as a client from my current host.

I'm a little confused.
With Freenom (And GoDaddy who I also use) when I set the nameservers to ns1 and ns2, I can't change the entries (adding an A record etc) but if I set the nameservers back to their own, I can. I'm a little unsure how this works.
I got a plain Linux apache server running once but I simply added an A record with my IP and it worked.
Do I keep my registrar's nameservers intact and just add the records with my IP?

Thanks for the help, I bet I'm being fairly dumb at this point so thanks for the patience!

P.S
After keeping my registrar's nameservers and adding A records for ns1, ns2, and srv2 (my server's domain (srv2.domain.com)) I get the same NXDOMAIN error when I try and visit domain.com, but I can access WHM using srv2.domain.com:2087. So why can I not access the domain.com as a website?
 
Last edited:

cPSamuelM

Technical Analyst Team Lead
Staff member
Nov 20, 2019
196
38
103
USA
cPanel Access Level
Root Administrator
Hello again @QueasyTiger

There's nothing to apologize for.

If you configure your domain to use custom name servers that resolve to your server, all DNS changes including adding an A record will be carried out within cPanel/WHM. If you use the name servers provided by Freenom and Godaddy, then all DNS management must be done at Freenom or Godaddy. You are free to use either option. Some users prefer to set up custom name servers that can be managed by cPanel/WHM so that the process of making DNS changes is easily accessible.

Another thing to note is that if you add A records pointing to your cPanel server for ns1, ns2, and srv2 at the registrar, you will also need to make sure that those records have been created on the cPanel server itself. This can be done in WHM. Refer to the "Create A or AAAA entries for your nameservers" section in the documentation I previously shared.

Feel free to let us know if you have any other questions!
 

QueasyTiger

Member
Jun 3, 2020
5
0
1
Scarborough, England
cPanel Access Level
DataCenter Provider
Hello again @QueasyTiger

There's nothing to apologize for.

If you configure your domain to use custom name servers that resolve to your server, all DNS changes including adding an A record will be carried out within cPanel/WHM. If you use the name servers provided by Freenom and Godaddy, then all DNS management must be done at Freenom or Godaddy. You are free to use either option. Some users prefer to set up custom name servers that can be managed by cPanel/WHM so that the process of making DNS changes is easily accessible.

Another thing to note is that if you add A records pointing to your cPanel server for ns1, ns2, and srv2 at the registrar, you will also need to make sure that those records have been created on the cPanel server itself. This can be done in WHM. Refer to the "Create A or AAAA entries for your nameservers" section in the documentation I previously shared.

Feel free to let us know if you have any other questions!
Hi again, thanks for all the help.
I've run into another, bigger problem though.
Since I'm just using the trial to get to grips with the software, I am running the servers from home. Trouble is, I don't have a static IP, and my ISP doesn't provide that service. When I set up the server, I used my public IP for access, but now my IP has changed, it never occurred to me that I wouldn't be able to access it!
I have physical access via VMWare remote console and also via ssh, but I can't figure out how to change the IP so I can log into the WHM panel again.
So far this has been a bit of a disaster. I know my circumstances are far from ideal, and this isn't something that should be an issue, but I still want to try and get this working if possible.
If however, there is no way to change the IP via the command line, I'll just wait until I get office space and a static IP.

Hope I can get some help >_<
Thanks.
 

cPSamuelM

Technical Analyst Team Lead
Staff member
Nov 20, 2019
196
38
103
USA
cPanel Access Level
Root Administrator
Hello again @QueasyTiger

The supported way to update the server's primary IP address is using the IP Migration Wizard in WHM:

https://docs.cpanel.net/whm/ip-functions/ip-migration-wizard/

You might want to try accessing WHM via its local IP address on your home network so that you can use the IP Migration Wizard interface.

If it is not possible to do so, then you will likely need to make the required changes manually via SSH. Note that this task is not something we would be able to provide support for directly. You might find the steps listed in the following forum post helpful:

https://forums.cpanel.net/threads/c...-ip-and-sites-on-server-will-not-load.407042/

Please let us know if you have any questions.
 

QueasyTiger

Member
Jun 3, 2020
5
0
1
Scarborough, England
cPanel Access Level
DataCenter Provider
Hello again @QueasyTiger

The supported way to update the server's primary IP address is using the IP Migration Wizard in WHM:

https://docs.cpanel.net/whm/ip-functions/ip-migration-wizard/

You might want to try accessing WHM via its local IP address on your home network so that you can use the IP Migration Wizard interface.

If it is not possible to do so, then you will likely need to make the required changes manually via SSH. Note that this task is not something we would be able to provide support for directly. You might find the steps listed in the following forum post helpful:

https://forums.cpanel.net/threads/c...-ip-and-sites-on-server-will-not-load.407042/

Please let us know if you have any questions.
Okay, so accessing the server via the local IP gives me this result:
1591959200052.png
Unfortunately, I can't go any further.
As for changing the IP through the command line, everything seems to be in order.
The only way I can think of accessing the server at this point is changing the public IP of the server to access WHM. Is this possible?

Also thanks for being patient.
I might cut my losses and start again since I have learned a lot so far, if you think that it might be easier than fixing my current configuration.

Thanks again!