Skip to content

Instantly share code, notes, and snippets.

@codygreen
Last active Mar 4, 2022
Embed
What would you like to do?
CoreDNS on OS X for Nginx Ingress DNS Resolution

Setup

brew install coredns
mkdir ~/.config/coredns
cd ~/.config/coredns
git co https://github.com/codygreen/codygreen.local.git
ln -s ~/.config/coredns /usr/local/etc/
sudo brew services restart coredns
sudo mkdir -v /etc/resolver
printf "port 1053\nnameserver 127.0.0.1\n" > /etc/resolver/codygreen.local

Troubleshooting

sudo brew services stop coredns
/usr/local/opt/coredns/bin/coredns -conf /usr/local/etc/coredns/Corefile
# test internal resolution
dig @127.0.0.1 -p 1053 ns.codygreen.local
# test external resolution
dig @127.0.0.1 -p 1053 ns.codygreen.com
# Check mDNSResponder for codygreen.local
scutil --dns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment