DnsHack hijacks some of your DNS
resolutions so that your machine
does not have to rely on external network.
Services like nip.io
or xip.io
can be sometimes blocked by your DNS
servers, or you may find yourself without connectivity.
You can use dnsmasq
or any other of the bazillion possible tools.
Possibly, but the instructions are only for macOS.
No idea, solved my problem today.
Forward the domain names to the local server
$ sudo cat <<EOF > /etc/resolver/xip.io
port 5300
nameserver 127.0.0.1
EOF
$ sudo cp /etc/resolver/xip.io /etc/resolver/nip.io
$ sudo cp /etc/resolver/xip.io /etc/resolver/test
build the server
$ make
and start the server automatically (replace the quoted [items]
with your values)
$ sudo cat <<EOF > /Library/LaunchDaemons/dns.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>dnshack</string>
<key>Program</key>
<string>[path to the binary]</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>UserName</key>
<string>[username]</string>
<key>GroupName</key>
<string>staff</string>
<key>InitGroups</key>
<true/>
</dict>
</plist>
EOF
$ sudo launchctl load -w /Library/LaunchDaemons/dns.plist
dnshack
is released under the terms of the MIT License.