Skip to content

How to block any domain from pointing to your server's IP address ?

0

my website mywebsite.com is running on lightsail, dns by cloudflare. Recently, I found that a weird website (badsite.id) pointing to my server's IP address. my situation is the same as https://webmasters.stackexchange.com/questions/101007/somebody-elses-domain-name-is-pointing-to-my-server-ip-address-and-google-is-in but not sure how to solve this.

appreciate if someone could help point me out step by step how to block any domain from pointing to my server's IP address .

Regards

James

2 Answers
1
Accepted Answer

Afraid this is not possible. Anyone with a DNS Servers can point to any IP Address on the internet.

What you should do is make sure you have

  • Host Headers Setup
  • Implement a CORS policy
  • Implement WAF which restricts host headers to your website
EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

EXPERT

reviewed 2 years ago

0

The quickest and easiest solution is to allow-list the 'Host' request headers in Apache httpd.conf and block requests that do not match. You can do this is a number of ways:

  • using mod_authz_host e.g. "Require host mywebsite.com'
  • using mod_rewrite to check %{HTTP_HOST} variable
  • define Apache vHosts and use a default vHost to block access
AWS
EXPERT

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.