how to make a layer7 rule that resolve a hostname ?!

how to make a layer7 rule that can resolve hostnames of port 443s and 80s connections and then block specific ones in the firelwall ?