Gravity Domain Filtering Different

There seems to be a difference between the V5 and V6 gravity domain filtering.

Setup: I have one bare metal Pi-hole running V5 and another one running V6. V6 is set as main DNS server for network.

I use this list https://raw.githubusercontent.com/chadmayfield/my-pihole-blocklists/master/lists/pi_blocklist_porn_all.list to filter porn sites for my kids devices.

V5 gravity accepts all entries:

  [i] Target: https://raw.githubusercontent.com/chadmayfield/my-pihole-blocklists/master/lists/pi_blocklist_porn_all.list
  [✓] Status: Retrieval successful
  [✓] Parsed 1906594 exact domains and 0 ABP-style domains (ignored 0 non-domain entries)
  [i] List stayed unchanged

V6 rejects many:

[i] Target: https://raw.githubusercontent.com/chadmayfield/my-pihole-blocklists/master/lists/pi_blocklist_porn_all.list
  [✓] Status: Retrieval successful
  [✓] Parsed 1905909 exact domains and 0 ABP-style domains (blocking, ignored 685 non-domain entries)
      Sample of non-domain entries:
        - "anime5pornlp1663.blogspot.r-porn-dvd-clips-.blogspot.ae"
        - "anime5pornlp1663.blogspot.r-porn-dvd-clips-.blogspot.al"
        - "anime5pornlp1663.blogspot.r-porn-dvd-clips-.blogspot.am"
        - "anime5pornlp1663.blogspot.r-porn-dvd-clips-.blogspot.ba"
        - "anime5pornlp1663.blogspot.r-porn-dvd-clips-.blogspot.be"

My MacBook will resolve those IP's using Pi-hole V6 as resolver:

% dig anime5pornlp1663.blogspot.r-porn-dvd-clips-.blogspot.ae

; <<>> DiG 9.10.6 <<>> anime5pornlp1663.blogspot.r-porn-dvd-clips-.blogspot.ae
;; global options: +cmd

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56485
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232

;; QUESTION SECTION:
;anime5pornlp1663.blogspot.r-porn-dvd-clips-.blogspot.ae. IN A

;; ANSWER SECTION:
anime5pornlp1663.blogspot.r-porn-dvd-clips-.blogspot.ae. 300 IN CNAME blogspot.l.googleusercontent.com.
blogspot.l.googleusercontent.com. 300 IN A 142.251.33.97

;; Query time: 153 msec
;; SERVER: 192.168.10.25#53(192.168.10.25)
;; WHEN: Wed Oct 18 20:34:39 PDT 2023
;; MSG SIZE rcvd: 146

V5 log: https://tricorder.pi-hole.net/PvqnlGax/

V6 log: https://tricorder.pi-hole.net/vp7OaIJo/

This is a regression of

because

is considered an invalid pattern in the following code:

			// Domain must not contain a hyphen immediately before a
			// dot or two consecutive dots
			if(domain[i] == '.' && (domain[i-1] == '-' || domain[i-1] == '.'))
				return false;

This needs to be relaxed, see the following proposed bugfix PR

1 Like

Thanks for the quick fix and I appreciate your work on this awesome project.