AWS Security Group, Azure Network Security Group, GCP Firewall Service, by default support FQDN based firewall rules (e.g. www.yahoo.com) as a destination in their configuration, to allow/block traffic to the specified domain.
GCP Firewall Service, others not AWS Security Group does, others not
FQDN -- Fully Qualified Domain Name.
Azure Firewall Applicaon Rule: Configure fully qualified domain names (FQDNs) that can be accessed from a subnet. In Azure, You can limit outbound HTTP/S traffic to a specified list of fully qualified domain names (FQDN) including wild cards.
AWS - You can use a third-party solution to implement highly available, secure FQDN Egress Filtering