Author Topic: Domain and sub-domains point to same test page on new install  (Read 5025 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Domain and sub-domains point to same test page on new install
« on: December 04, 2019, 06:00:58 PM »
I've set the A-record for my domain in the registrar's control panel to point to the server IP, and also a wildcard A-record for sub-domains.

I've then added a user account and domain to CentOS Web Panel and also added 2 sub-domains in the user control panel. I've set the nameservers to be `ns1.somedomain.com` and `ns2.somedomain.com` where somedomain.com is the same domain as on the user account. I've checked the DNS records exist for the domain and sub-domains and they all point to the server IP. I've enable SSL for each although that has not entirely worked.

I've edited the index.html test page in the domain and sub-domain directories so that I know which is being displayed. However when I try to navigate to either the domain or sub-domains I see the same unedited test page, not the edited version. If I add a phpinfo.php page then I get 404 not found error.

Any ideas what I might have done wrong please?

Offline
*****
Re: Domain and sub-domains point to same test page on new install
« Reply #1 on: December 04, 2019, 10:26:24 PM »
try rebuild vhosts on Select WebServers menu option

Offline
*
Re: Domain and sub-domains point to same test page on new install
« Reply #2 on: December 15, 2019, 11:32:12 PM »
I tried rebuilding as suggested but no change.

I've now set the nameservers in CWP to be ns1.mydomain.com and ns2.mydomain.com and specified the server IP. Then similarly set the nameservers in CWP. After saving the webserver setup I see a warning at the top: "Possible NAT networking detected, Please check the following settings" and 'Edit NAT settings' button. There's a NAT local IP 10.154.0.5 set, should that be used as for the IP in the domain local DNS records?

Offline
*
Re: Domain and sub-domains point to same test page on new install
« Reply #3 on: December 16, 2019, 12:55:41 PM »
I've changed the server ns records to those of my domain registrar with corresponding IPs; is that the correct setting if not using own nameservers or should the setting be left as default, ie CWP ns?

I notice that the BIND DNS service is failing, and in the error log it says:

Quote
zone mydomain.com/IN: has no NS records
zone mydomain.com/IN: not loaded due to errors.
_default/mydomain.com/IN: bad zone
zone ns1.mydomain.com/IN: loading from master file /var/named/ns1.mydomain.com.db failed: file not found
zone ns1.mydomain.com/IN: not loaded due to errors.
_default/ns1.mydomain.com/IN: file not found
zone ns2.mydomain.com/IN: loading from master file /var/named/ns2.mydomain.com.db failed: file not found
zone ns2.mydomain.com/IN: not loaded due to errors.
 _default/ns2.mydomain.com/IN: file not found
zone cp.ezy-web.uk/IN: loaded serial 2019121649
zone cp.mydomain.com/IN: loaded serial 2019121649
zone ns-uk.topdns.com/IN: loaded serial 2013071600
zone ns-usa.topdns.com/IN: loaded serial 2013071600
Dec 16 11:29:18 cp.mydomain.com systemd[1]: named.service: control process exited, code=exited status=1
Dec 16 11:29:18 cp.mydomain.com systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).

Could the configuration have been corrupted by switching between setting up for own nameservers and registrar nameservers?
« Last Edit: December 16, 2019, 12:58:37 PM by nickw »