domain is pointing to server instead of newly created cpanel account

kapilkd13

Member
Jun 9, 2016
5
0
1
delhi
cPanel Access Level
Reseller Owner
I have installed cPanel & WHM: The Hosting Platform of Choice on my ec2 micro instance. Now I am trying to run a website on it. I created a new account with whm which points to the same ip as my server ip(WHM generated it, means I didn't get to choose which ip to use). Now the server ip is a amazon elastic ip. I only have this ip.
I checked the option to use domain registrar nameserver and on dot tk panel I used their free DNS. They supply their default nameservers. I pointed this domain to only ip I have i.e server ip. Now when I user that domain it takes me to server page. example.tk/cgi-sys/defaultwebpage.cgi example.tk is my domain name. But what I want is it should take me to exampke.tk/~user5/ here user5 is my newly created account username.It's for test purpose I will change it. I am working on this for 3 days but couldn't figure out what to do. according to me problem is that my whm nameserver( I choose bind is not working). I have tried using my own DNS in dot tk panel but I only have 1 ip address so where should I point nameservers. For test purpose I pointed both nameservers to my server ip(amazon elastic ip) and opened port 53(for inbound) on aws setting and choosing anywhere access.
On my list accounts page, when I click on domain link it takes me to the server ip and when i click on ip address it takes me correct destination. I think problem is my server cannot point domain to correct destination.

Can I do this using 1 ip only. Also I have no problem in using server root ip to host my website, if it just takes me to my website homepage. but you can see on above first link it takes me to a page which shows some error.
I want to know how to configure my domain that it point to correct address. Any help would be appreciate. Thanks
 
Last edited by a moderator:

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
160
168
New Jersey
cPanel Access Level
DataCenter Provider
If you are using dot.tk's name servers then doing anything DNS related in cPanel is pretty much null.

As long as you added the exact domain name into cPanel, and you have an A Record set to the IP of your server, then the site should load.

Can you confirm your domain is resolving to the IP showing if you go to WHM > List Accounts

If it is, then clear your browser history and try to view your website again.
 

kapilkd13

Member
Jun 9, 2016
5
0
1
delhi
cPanel Access Level
Reseller Owner
Also, you will have to make sure that you have to set your server's hostname same as your domain name otherwise it will not work. Server's hostname should not be live website.
Hi Kailash
In some tutorials I saw them using different hostname and using new domain to host websites. I will change it to my original domain as you say like host.my-domain.tk. After doing this do I have to change anything in my domain registrar.
Also
When I look into the list accounts in whm it shows domain column that list my domain and a Ip address column that has a hyperlinked ip address. when I click onto that hyperlinked ip address it takes me to correct address, showing my website. But when I click onto domain name present in domain column, it takes me to my server ip address my-server-ip/cgi-sys/defaultwebpage.cgi is shown. Note that I have created multiple accounts trying to get it right. So I have many rows each having different domain name but same Ip address(my-server-ip). Now surprisingly these ip address look same but when I click on them they take me to their corresponding accounts webpage. I dont want to host multiple accounts and I have no problem deleting all but 1 if it solves anything. Thanks
 
Last edited by a moderator:

kapilkd13

Member
Jun 9, 2016
5
0
1
delhi
cPanel Access Level
Reseller Owner
Note that I have created multiple accounts trying to get it right. So I have many rows each having different domain name but same Ip address(my-server-ip). Now surprisingly these ip address look same but when I click on them they take me to their corresponding accounts webpage. I dont want to host multiple accounts and I have no problem deleting all but 1 if it solves anything. Thanks
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
160
168
New Jersey
cPanel Access Level
DataCenter Provider
When you ping the domain that you are trying to access, does it resolve to the IP that shows in WHM > List Accounts?
 

kapilkd13

Member
Jun 9, 2016
5
0
1
delhi
cPanel Access Level
Reseller Owner
hi Jcats,
Yes when I ping the domain through terminal it shows my server ip. This is the same IP that is shown in list accounts. but when I put the domain on google it takes me to defaultwebpage.cgi . It looks like domain is resolving to server IP but from there it is not getting redirected to specific account associated with that account. Again IP present in List accounts and my server IP is same. And in list accounts IP is hyperlinked and takes me to its respective accounts default.html page(where I want to go.)
 

kapilkd13

Member
Jun 9, 2016
5
0
1
delhi
cPanel Access Level
Reseller Owner
hi Jcats,
Yes when I ping the domain through terminal it shows my server ip. This is the same IP that is shown in list accounts. but when I put the domain on google it takes me to defaultwebpage.cgi . It looks like domain is resolving to server IP but from there it is not getting redirected to specific account associated with that account. Again IP present in List accounts and my server IP is same. And in list accounts IP is hyperlinked and takes me to its respective accounts default.html page(where I want to go.)
Also if its possible for you can you suggest me sources where i can get insight of how a server resolves request to there specific account mainpage because each website doesn't have a dedicated ip and user request go to server's ip.
 

Kailash1

Well-Known Member
Nov 27, 2006
260
6
168
cPanel Access Level
Root Administrator
Twitter
In some tutorials I saw them using different hostname and using new domain to host websites. I will change it to my original domain as you say like host.my-domain.tk. After doing this do I have to change anything in my domain registrar.
Did you set same hostname as your main domain name? If that was the case, you will have to delete any recreate your domain after changing server's hostname. The hostname which you set for your server should not be live website. You will see this caution on change hostname screen as well.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello,

First, check to see which IP address one of the domain names resolves to, and verify it's the same IP address configured for the account on the cPanel server. Then, let us know the output (without real IP addresses) from the following command:

Code:
/scripts/build_cpnat
Thank you.