Set boundaries on a computer
On a computer, browsing is spread across several browsers and accounts, so a barrier works best at the level of the system or the account rather than inside one browser. Two approaches are covered here: Microsoft Family Safety for Windows accounts, and the hosts file that both Windows and macOS read.
- Covers
- This computer, or one supervised account
- Misses
- Other computers and phones
- Key held by
- Whoever has the admin password
ComputerWindows accounts with Microsoft Family Safety
Family Safety lets the organiser of a Microsoft family group set web and search filters for member accounts. The web filter works through Microsoft Edge, and other browsers are blocked on the supervised account, so switching browsers does not step around it. Filters apply to members rather than to the organiser, so the arrangement suits a case where a trusted adult organises the group and your account is a member.
- Sign in to the Microsoft family site with the organiser's account and add your Microsoft account to the group.
- Open your entry in the group and find the content filters for web and search.
- Switch on the filter for inappropriate websites.
- Add gambling addresses to the blocked list, or choose the option that allows only approved websites for a stricter setting.
- Check that the Windows sign-in you use every day is the supervised account, and let the organiser keep the password.
The hosts file, explained
The hosts file is a plain text list that tells the operating system which address to use for a name before it asks DNS. Pointing a name at 0.0.0.0 sends the request nowhere, so the site does not load. The lines below use reserved placeholder names, not real sites.
0.0.0.0 gambling-site.example
0.0.0.0 www.gambling-site.example
- Windows
- The file is C:\Windows\System32\drivers\etc\hosts. Open Notepad with Run as administrator, open the file, add one line per name, save, then run
ipconfig /flushdnsin a terminal. - macOS
- The file is /etc/hosts. Edit it with administrator rights in a terminal text editor such as nano, add one line per name and save. Clearing the DNS cache afterwards makes the change apply at once, and the command varies by macOS version.
- Before editing
- Copy the original file somewhere safe and leave existing lines alone. A mistyped existing line can break lookups for another site.
Where each control lives
| Control | Windows | macOS |
|---|---|---|
| Name-by-name block list | hosts file in drivers\etc | /etc/hosts |
| Account-based web filter | Microsoft Family Safety, through Edge | Screen Time, Content & Privacy, Web Content |
| Everyday account with fewer rights | A standard account under Settings, Accounts | A standard user under System Settings, Users & Groups |
Limits of the hosts file
- Each name is blocked exactly as written, and the www version is a separate entry.
- There are no wildcards, so a site that moves to a new address is not caught.
- It affects one computer only.
- Anyone with administrator rights can delete the lines.
Shared accounts and standard accounts
A standard account cannot edit the hosts file or install system software without an administrator password. Using a standard account day to day, with the administrator password kept by someone else, adds a deliberate step before any change. If the computer is shared, give each person their own account so a restriction on one does not depend on the habits of another.
Browsers also have their own secure DNS option, which sends lookups to a provider chosen inside the browser. It is worth knowing whether that setting is on if you rely on router filtering, and the router guide explains the effect.