Apple published the list of domains for network administrators, managing access to various Apple online services. Look up the section "Software Updates" for domains of interest.
Assuming you know how to edit text files in the Terminal with such editors as vim or nano, type
Code:
sudo vim /etc/hosts
or
Code:
sudo nano /etc/hosts
. After submitting your admin pass, add the domains you want to block to this file. Under no circumstances modify the default settings. Luckily, Apple foresaw the need to prepend the file contents with a warning. Then save your changes.
The formula of a line to be added is the following:
Code:
apple_domain 127.0.0.1
, where 127.0.0.1 is your machine (its local address as seen to you), meaning that instead of following the macOS connections routing table to resolve domain names, it will take your machine for the target domain and loop back all the outgoing connections. The domain part and the machine IP address must be delineated with a space, exactly as in the examples.