Brendan Gooden
Brendan Gooden

Reputation: 1551

Block website users if their IP address resolves to a specific domain

In this article, the answer points out that restricting access according to domain name means that the server has to perform DNS lookup for each request, which makes sense - this is not something you would want to do.

That being said, is there a way to reverse lookup all IP addresses that resolve to a domain, and all of its sub-domains? Thus compiling a list of IP addresses for which to block requests.

Is there a way of finding all these sub domains and then performing DNS lookup?

Upvotes: 0

Views: 86

Answers (1)

user3967089
user3967089

Reputation:

Practically, no, there is no general way to find all the names in a zone. There may be ways for a particular zone, but it's fairly rare.

But then, this also looks a whole lot like an A-B question. You probably don't want to block anyone connecting from an IP that reverse-lookups to a particular domain name just for fun, you probably want to block people coming from some kind of organization or entity from connecting. So look up what IP ranges that organization/entity owns, and block those. No DNS needed.

Upvotes: 1

Related Questions