Prevent Unparked Domains Resolving on Dedicated IP

Craig.

Registered
Mar 7, 2018
1
0
1
IOM
cPanel Access Level
Root Administrator
Hi

I've seen a couple similar threads but couldn't find a solid resolution to what I'm experiencing

If I set up an account in WHM "domain.com" and give it the dedicated IP "123.12.34.123"

Then, I point an A record on "domain.com" to 123.12.34.123

I can see the website content on example.com and on 123.12.34.123

This is all fine and as expected, however...

If I then register the domain "domain.com" and point an A record to 123.12.34.123

I can then access the whole website from somethingelse.com

How can I prevent an unrelated third party domain from resolving the website on a dedicated IP?

I need the solution to be server wide, there must be a way to switch this behaviour off and only resolve domains that have been added in to cPanel/WHM

Thanks
Craig
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
If I then register the domain "domain.com" and point an A record to 123.12.34.123

I can then access the whole website from somethingelse.com

How can I prevent an unrelated third party domain from resolving the website on a dedicated IP?

I need the solution to be server wide, there must be a way to switch this behaviour off and only resolve domains that have been added in to cPanel/WHM
Hi Craig,

Here are a few third-party URLs you may find helpful:

Block a random domain pointing at my dedicated IP
How do I configure my Apache web server to respond only to requests made to it's domain name and not the IP address?
How should I block unwanted domain names?

Generally, the easiest approach to prevent this from happening is to setup a default VirtualHost entry for the dedicated IP address, but note this will prevent direct access to the website over the IP address.

Thank you.