You want to restrict outgoing emails from users to external addresses.
You can set up a routing rule to reject outgoing emails from your domain to external addresses by following these steps:
- In your Admin console, go to Apps > Google Workspace > Gmail > Routing.
- Click Configure.
- Add a description for your rule.
- Under Email messages to affect, check the box for Outbound.
- Under For the above types of messages, select Reject message.
- (Optional) Add a custom rejection message.
- Click Show options.
- Check the box for Use address lists to bypass or control application of this setting.
- Select Apply address lists to correspondents.
- Select Bypass this setting for specific addresses / domains.
- Click Create or Edit list.
- Add a name for the address list.
- Click Add.
- Enter your domain name.
- Click Save.
- Back on the routing rule screen, click Save.
Creating a custom routing rule to reject outbound messages and only allowing emails sent within the domain.
Default setting will allow outbound emails to all domains.