This workaround is for V4. In V5, the contents of /etc/resolv.conf are not changed.
Note that if you change the nameserver on the Pi to something other than Pi-hole in V4, the Pi will not be able to map IPs to host names in the query log and long term database.