We recently had a Heroku support ticket where a user needed to modify their DNS lookup inside their app: We’re connecting to an external API that requires a custom DNS entry. Locally, we modify our /etc/hosts file. How can we do this inside our app? Modifying your /etc/hosts file is a common process for tweaking your local DNS lookup. Your machine will first check this file for any custom entries