You can enable and change Bluestacks 5 Private DNS setting via ADB to block all ads on Bluestacks! Enable ADB option from settings. Enable PrivateDNS feature DNSOverTLS server to NextDNS or AdguardDNS to block advertisements with ADB. Alternatively you can access ADB via BSTweaker.
# enable private dns with hostname (example with dns.adguard.com)
adb shell settings put global private_dns_mode hostname adb shell settings put global private_dns_specifier dns.adguard.com
Also don’t forget to remove permissions of Program Files Bluestacks_nxt Engine Pie Promotions folder!
# disable private dns adb shell settings put global private_dns_mode off