Unfortunately, this is not doable at the DNS level. You need a browser extension like uBlock Origin for that.
May I suggest to try Ad blocking apps? Such as Blokada Or Adguard.
If you're using Adguard then apply NextDNS TLS or HTTPs under Adguard DNS If you're using Blokada (free open source) Just enable ad protection & disable DNS to continue with NextDNS blocking.