How to Configure Mastodon to Reject Posts From Specific Relays
🔍 WiseChecker

How to Configure Mastodon to Reject Posts From Specific Relays

Mastodon relays are servers that broadcast public posts from multiple instances to your instance. They help populate your federated timeline with content from many communities. However, some relays may carry spam, low-quality posts, or content that does not align with your instance’s rules. This article explains how to configure Mastodon to reject posts from specific relays, giving you control over the content that enters your instance. You will learn the exact steps to block a relay and how to verify that the block is working.

Key Takeaways: Blocking Unwanted Mastodon Relays

  • Administration > Server Settings > Relays: Lists all connected relays and allows you to remove or block them.
  • Administration > Federation > Domain Blocks: Enables you to block the relay’s domain, preventing all incoming posts from that relay.
  • Moderation > Reports > Relay Reports: A way to report problematic relays to the Mastodon team, but not a direct block method.

ADVERTISEMENT

How Mastodon Relays Work and Why You Might Block One

A Mastodon relay is a server that subscribes to public posts from many instances and then redistributes those posts to all instances that subscribe to the relay. When your instance subscribes to a relay, the relay sends all public posts it receives to your instance. This can quickly fill your federated timeline with content, but it also means you have less control over what appears. If a relay is known for distributing spam, hate speech, or other unwanted content, blocking that relay prevents those posts from reaching your instance.

Relays are often used by smaller instances to increase the volume of content available to their users. However, the trade-off is that you may receive content that violates your instance’s rules. Blocking a specific relay does not affect your subscription to other relays. It also does not block individual instances that are not relay servers. The block targets only the relay’s domain.

Prerequisites for Blocking a Relay

To block a relay, you need administrator access to your Mastodon instance. You must know the domain name of the relay you want to block. Common relay domains include relay.example.com or pub-relay.example.org. If you are unsure of the relay’s domain, check the Administration > Server Settings > Relays page. It lists all relays your instance is currently subscribed to.

Steps to Reject Posts From a Specific Mastodon Relay

Follow these steps to block a relay and stop its posts from appearing in your instance. Perform each step in order.

  1. Open the Administration panel
    Log in to your Mastodon instance with an account that has administrator privileges. Click the hamburger menu (three horizontal lines) in the upper right corner. Select Preferences, then click Administration in the left sidebar.
  2. Go to Server Settings
    In the Administration menu, click Server Settings. This page contains general configuration options for your instance.
  3. Find the Relays section
    Scroll down to the Relays section. You will see a list of all relays your instance is currently subscribed to. Each entry shows the relay’s URL and a status indicator (connected, pending, or disabled).
  4. Identify the relay you want to block
    Locate the relay you wish to reject. Note its full domain name (for example, relay.badcontent.com). If you have many relays, use the browser’s search function (Ctrl+F) to find the specific domain quickly.
  5. Remove the relay subscription
    Click the Remove button next to the relay’s entry. This unsubscribes your instance from that relay. After removal, the relay will stop sending new posts to your instance. However, posts that were already received may still appear in the timeline. To prevent those, proceed to the next step.
  6. Block the relay domain
    Go to Administration > Federation > Domain Blocks. Click the Add new domain block button. In the Domain field, enter the relay’s domain exactly as it appeared in the Relays list (for example, relay.badcontent.com). Select the severity level: Suspend is the most restrictive and will delete all existing posts from that domain. Silence hides posts from the public timeline but allows them in the home timeline. For a relay, Suspend is recommended. Click Add domain block to confirm.
  7. Verify the block is active
    Return to Administration > Federation > Domain Blocks. The blocked domain should appear in the list with the severity you selected. You can also check Administration > Server Settings > Relays to confirm the relay no longer appears in the subscription list.

ADVERTISEMENT

Common Issues When Blocking Mastodon Relays

Posts From the Blocked Relay Still Appear in Timelines

If you only removed the relay subscription without adding a domain block, posts that were previously received may remain in your database. To remove them, you must either wait for them to age out or use the domain block with the Suspend severity. Suspending the domain deletes all existing posts from that relay. Note that this action cannot be undone for individual posts, so ensure you want to permanently delete that content.

The Relay Domain Is Not Listed in Domain Blocks

If you cannot find the relay domain in the Domain Blocks list after adding it, refresh the page. If it still does not appear, check that you entered the domain correctly. Domain blocks are case-insensitive, but spelling errors will prevent the block from working. Also, ensure you clicked the Add domain block button after filling in the fields.

Blocking a Relay Does Not Block Individual Instances

Blocking a relay only stops posts that come through that relay. If an individual instance is posting spam directly to your instance (not via a relay), you must block that instance separately. Go to Administration > Federation > Domain Blocks and add the instance’s domain. This is a common misunderstanding; a relay block does not protect you from direct federation with a problematic instance.

You Accidentally Blocked the Wrong Relay

If you blocked a relay by mistake, you can remove the domain block. Go to Administration > Federation > Domain Blocks, find the blocked domain, and click the Remove button. Then, you can re-subscribe to the relay by going to Administration > Server Settings > Relays and entering the relay’s URL again. Note that removing a domain block does not restore deleted posts; you will only receive new posts going forward.

Mastodon Relay Blocking vs Instance Blocking

Item Blocking a Relay Blocking an Instance
Scope Blocks all posts originating from the relay server only Blocks all posts from the instance, including direct federation
Effect on existing posts Only new posts are stopped unless a domain block with Suspend is added Existing posts are deleted if Suspend is chosen
Impact on other relays No effect on other relay subscriptions No effect on relay subscriptions
Use case When a specific relay distributes unwanted content When an individual instance violates rules

Understanding the difference helps you apply the correct block. If you block a relay, posts from that relay will stop, but the instances that fed into the relay can still reach you through other relays or direct federation. To fully isolate your instance from a specific source, block both the relay and the instance domain.

Conclusion

You can now configure Mastodon to reject posts from specific relays by removing the relay subscription and adding a domain block with Suspend severity. This gives you fine-grained control over your federated timeline. After blocking, verify the relay no longer appears in the Relays list and that the domain block is active. For ongoing moderation, regularly review the Relays section to ensure only trusted relays are connected. If you need to block an individual instance instead, use the Domain Blocks tool with that instance’s domain.

ADVERTISEMENT