Skip to content

Instantly share code, notes, and snippets.

@githubutilities
Last active October 9, 2025 03:29
Show Gist options
  • Save githubutilities/0a6b7eedf6ad64fc1340 to your computer and use it in GitHub Desktop.
Save githubutilities/0a6b7eedf6ad64fc1340 to your computer and use it in GitHub Desktop.
Jailbreak iPhone as DNS Server

Use Jailbreak iPhone as DNS Server

1. Install dnsmasq

# install "dnsmasq" package from `ModMyi`
apt-get install uk.org.thekelleys.dnsmasq

2. Edit your /etc/resolv.conf

/etc/resolv.conf

nameserver 8.8.8.8

3. Done!

Tools

Basic network utilities package

  • ping - "inetutils"(Cydia)
  • nslookup, dig, host - "BIND DNS Server"(Cydia), which also needs /etc/resolv.conf file
  • traceroute - "network-cmds"(Cydia)

List package install file using dpkg

# list all installed packages
dpkg -l

# list installed package's files
# `-L` stands for `--listfiles`
dpkg-query -L <package_name>
#or
dpkg -L <package_name>

# list files that `deb` package will install
# `-c` stands for `--contents`
dpkg-query -c <package_name.deb>

for more, please visit here

DNS Server using /etc/hosts

  • expose DNS port which is 53(includes DNS(TCP) and DNS(UDP)) in most cases
  • change /etc/resolv.conf to configure dns server, e.g. you can use 8.8.8.8 as your nameserver
  • install dnsmasq
apt-get install dnsmasq
service dnsmasq start
  • edit /etc/dnsmasq.conf and add additional host file config - addn-hosts=/etc/hosts.acme

difference between dnsmasq and resolvconf can be found here

Wildcard in dnsmasq

Add this line address=/googlevideo.com/127.0.0.1 to /etc/dnsmasq.conf.

NOTE: 127.0.0.1 is the ip you want to resolved to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment