When your Mastodon server subscribes to a relay, it receives boosted posts from many remote instances. These boosts can bring unwanted content from domains you do not want your users to see. A relay does not filter content by domain before sending it to your server. To stop a specific domain from reaching your users through a relay, you must apply a server-level block. This article explains how to block a domain at the federation level so that relay-fed content from that domain never appears on your instance.
Mastodon relays work by collecting public boosts from all participating servers and redistributing them. If one of those servers contains a domain you consider harmful, spam, or off-topic, the relay will continue to deliver its posts. The block must happen on your server, not on the relay itself. You will use the moderation tools built into Mastodon to reject or silence the offending domain.
This guide covers the exact steps for blocking a domain and explains what happens to existing posts from that domain. It also covers common mistakes that can leave the block ineffective.
Key Takeaways: Blocking a Domain from a Mastodon Relay
- Administration > Server Settings > Federation > Domain Blocks: The moderation panel where you add a new domain block for relay-fed content.
- Block severity levels (Reject / Silence / Suspend): Reject media prevents images from loading; Silence hides the domain from local timelines; Suspend removes all content and prevents future contact.
- Reject media + Silence: The recommended combination for stopping relay content without fully cutting off legitimate users who follow specific accounts on that domain.
Why a Domain Block Is Needed for Relay Content
A Mastodon relay is a server that collects public boosts from multiple instances and redistributes them to all subscribed servers. When your instance is connected to a relay, you receive boosted posts from every domain that the relay sees. The relay does not evaluate the reputation or trustworthiness of those domains. It simply forwards everything it receives.
If a domain on the relay starts posting spam, hateful content, or material that violates your server rules, your local timeline and federated timeline will show those posts. Individual users can mute or block accounts, but that does not stop the relay from continuing to deliver new posts from the same domain. A server-level domain block is the only way to stop all relay-fed content from that domain.
Mastodon offers three block severities. Each one affects how the domain interacts with your server:
Reject media
This option prevents media files from that domain from being downloaded and displayed on your server. Text posts still appear. Use this when the domain contains offensive images or videos but the text itself is acceptable.
Silence
Silencing hides all posts from the domain from public timelines. Users who follow someone on that domain can still see those posts in their home feed. This is useful when you want to reduce visibility without fully cutting off the domain.
Suspend
Suspension removes all existing posts from the domain from your server and prevents any future interaction. No user on your instance can see or interact with accounts on the suspended domain. This is the most aggressive block and is appropriate for spam or harassment domains.
For relay-fed content, the combination of Reject media and Silence is often the best choice. It stops the domain from flooding your timelines while still allowing users who intentionally follow accounts on that domain to see their posts.
Steps to Block a Domain from a Mastodon Relay
You must have moderator or administrator privileges on your Mastodon instance to perform these steps. If you do not have access to the moderation panel, ask your instance admin to apply the block.
- Log in to your Mastodon instance as an admin or moderator
Open your instance URL in a web browser and sign in with an account that has moderation permissions. Only accounts with the Admin or Moderator role can access domain blocks. - Open the moderation panel
Click the hamburger menu or your profile icon in the top-right corner. Select Preferences from the dropdown menu. In the left sidebar, click Administration and then Server Settings. - Navigate to Domain Blocks
In the Server Settings page, click the Federation tab. Then click Domain Blocks. This page lists all domains currently blocked on your instance. - Add a new domain block
Click the Add domain block button. A form appears with fields for the domain name and block severity. - Enter the domain you want to block
Type the full domain name in the Domain field. For example,spam-site.example. Do not include the protocol (https://) or any path. Subdomains are not automatically blocked. If you want to blocksub.spam-site.example, you must add it separately. - Select the block severity
Choose one of the three options: Reject media, Silence, or Suspend. For relay-fed content that is unwanted but not illegal, select Reject media and Silence by checking both checkboxes. If the domain is clearly spam or abusive, select Suspend. - Add an optional reason
You can type a private note in the Reason field. This note is visible only to your instance moderators. It helps other admins understand why the block was applied. - Save the block
Click the Add domain block button at the bottom of the form. The block takes effect immediately. Existing posts from that domain may take a few minutes to be removed from timelines if you chose Suspend.
Common Mistakes When Blocking a Domain from a Relay
Blocking the relay domain instead of the content domain
A common error is to block the relay domain (for example, relay.example) instead of the domain that is posting unwanted content. Blocking the relay stops all relay traffic, including content from legitimate domains. Always block the specific domain that is causing the problem, not the relay itself.
Forgetting to block subdomains
Mastodon domain blocks apply only to the exact domain you enter. If unwanted content comes from blog.spam-site.example and you block only spam-site.example, the subdomain content still reaches your users. Check the federated timeline to find the exact domain string used by the relay. Add that exact domain to the block list.
Using Suspend when Silence would suffice
Suspension removes all posts and prevents any future interaction. If users on your instance have legitimate followers on the blocked domain, those followers lose access to your users posts. Use Suspend only for domains that are clearly spam, illegal, or malicious. For unwanted relay content that is simply off-topic or low-quality, use Silence.
Not checking the federated timeline after the block
After applying a domain block, verify that no new posts from that domain appear on the federated timeline. If posts still show up, the domain you blocked may be different from the one used by the relay. Check the post details to see the exact originating domain and add that domain to the block list.
Domain Block Severity Comparison
| Item | Reject media | Silence | Suspend |
|---|---|---|---|
| Effect on existing posts | Media removed; text remains | Hidden from public timelines | All posts removed from server |
| Effect on future relay-fed content | Media not downloaded | Hidden from public timelines | Dropped entirely |
| Users can still follow accounts on that domain | Yes | Yes | No |
| Recommended for | Domains with offensive media | Off-topic or low-quality domains | Spam, harassment, illegal content |
After applying a domain block, you can monitor the federated timeline to confirm the block is working. If the domain continues to appear, double-check the exact domain string. You can also check the Domain Blocks list in the moderation panel to see all active blocks and their severity levels.
For persistent issues, consider removing your instance from the relay entirely. Go to Preferences > Administration > Server Settings > Federation > Relays and click Remove next to the relay. This stops all relay-fed content at once. You can re-add the relay later if needed.