I use a desktop application called heyfocus (https://heyfocus.com/) on mac. I have been curious for quite some time on how this application works. Whenever I investigate how people block websites they usually do it by making entries into the /etc/hosts file. I have used several desktop applications that don't take this approach and I have always wondered how they block websites. As far as I know, these apps also don't manipulate my DNS entries.
Just to clarify I am not trying to rip off this applications source code to make my own copy. I am just curious what API's etc... are being used to accomplish this.