Regex - How to block subdomains?
-
I'm trying to block a domain and all of it's subdomains, I've tried a few different methods and none seem to be working.
\.google\.With that, I can't get to www.google.com but can get to subdomains.
(\.|^)google\.com$Same results as above.
(^|\.)google\.com$Same results as above.
-
@creationguy said in Regex - How to block subdomains?:
I'm trying to block a domain and all of it's subdomains,
I suspect what you want to do is hard at the firewall level.
You could try blocking Googles ASN in pfblockerNG then white list what you want to allow. Unfortunately Google frequently changes the IP address each domain name resolves to, so to make this solution work, pfsense needs aliases with history (which I don't think are currently supported).Alternatively blocking it at the DNS may be possible.
-
Google was just an example, not the real domain. Wouldn't this be best accomplished within the pfBlocker package? That's what I'm trying to do.
It works in Pihole use the 1st regex, but not here.
-
Update:
(^|\.)domain\.com$Blocks the domain and subdomain... I just didn't clear my DNS cache on device. So far, it is working.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginPrivacy Policy · Cookie Policy