Monday, 2 January 2017

MS OneNote / OneDrive stops syncing using Pi-Hole

A quick post to let you know about how to work around the PITA issue of using Pi-Hole, Windows 10, OneNote and OneDrive

I recently rebuilt my Pi-Hole server, moving from a Raspberry Pi to a Ubuntu VM.

As soon as I started using the new DNS server it became apparent that there were a few issues with Microsoft services. First Skype wouldn't sign in properly and I did a bit og googling around and found some addresses that need to be whitelisted. Hmm, strange, why would I need to whitelist something as mainstream as Skype... ho hum I thought, it must be a one off.
Several days later I fired up OneNote on my new tablet (Google Pixel C by the way - fantastic device) only to be prompted to sign in to retireve the notebook stored on OneDrive - which promptly barfed and gave a "something went wrong, try again later message).
Great... so I tried it on my laptop and got the same issue... hmm, what's changed? Well only the PiHole server.
I dodn;t know what URL OneNote was accessing, but upon googling around I noticed that I could not access support.microsoft.com and decided to use this to track down the issue.

Logging on to the Pi-Hole server I ran:

root@dns:~# pihole -q support.microsoft.com

::: /etc/pihole/list.0.raw.githubusercontent.com.domains (2 results)
#               see: http://support.microsoft.com/kb/2764944
0.0.0.0 diagnostics.support.microsoft.com

::: /etc/pihole/list.1.mirror1.malwaredomains.com.domains (0 results)

::: /etc/pihole/list.2.sysctl.org.domains (0 results)

::: /etc/pihole/list.3.zeustracker.abuse.ch.domains (0 results)

::: /etc/pihole/list.4.s3.amazonaws.com.domains (0 results)

::: /etc/pihole/list.5.s3.amazonaws.com.domains (0 results)

::: /etc/pihole/list.6.raw.githubusercontent.com.domains (2 results)
diagnostics.support.microsoft.com #Microsoft
support.microsoft.com #Microsoft

::: /etc/pihole/list.preEventHorizon (2 results)
diagnostics.support.microsoft.com
support.microsoft.com

grep: /etc/pihole/blacklist.txt: No such file or directory
::: /etc/pihole/blacklist.txt (0 results)


Hmm, so it looks like whatever generated list.6.raw.githubusercontent.com.domains  is the issue... let's take a look at that

sudo vim /etc/pihole/adlists.default

This seems to be the problem site

# The below list amalgamates several lists we used previously.
# See `https://github.com/StevenBlack/hosts` for details
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts

Looks like they have chosen to be super paranoid and block legitimate non-ad-serving addresses because they include the list from https://github.com/crazy-max/WindowsSpyBlocker.

Now ideally I'd just use an option of the list that didn't exclude the microsoft domains, but that's not an option, so I just commented out the line like so
# https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts

Then reinitialised with 
/opt/pihole/gravity.sh

And everything started working!