It turns out that the DNS requests to compass.mongodb.com are coming from the MongoDB Snippets feature (experimental?). To stop the flood of DNS requests on a system that isn’t connected to the normal internet (so the requests can never succeed), you can turn off the Snippets feature using mongosh eval commands, and I think through a config file as well.
mongosh --nodb --eval 'config.set("snippetAutoload",false)'
mongosh --nodb --eval 'config.set("snippetIndexSourceURLs","")'