csrutil disable
Restart computer
In the terminal, type
sudo open /Applications/TextEdit.app /System/Library/LaunchDaemons/com.apple.ManagedClient.enroll.plist
change
<key>com.apple.ManagedClient.enroll</key>
<true/>
to
<key>com.apple.ManagedClient.enroll</key>
<false/>
So that the changes take effect
One option to block those hosts even if you are forced to do the installation while online is to use something like PiHole in your home network, and block the domains there. That way, even while installing the OS online, the machine won't be able to access those hosts. Not sure if they would stop the installer if can't connect though, but worth a try.