Shadowsockshole is a repository for deploying a Shadowsocks encrypted tunnel along with Unbound DNS server and Pi-hole ad blocker using Docker containers. It allows accessing blocked internet resources by routing DNS queries and traffic through an encrypted Shadowsocks tunnel.
Shadowsockshole is a Docker-based solution for deploying a Shadowsocks tunnel along with Pi-hole and Unbound DNS server. This setup enables access to blocked resources by bypassing censorship.
install.sh
: Installation scriptdocker-compose.yml
: Docker container descriptionsunbound/unbound.conf
: Unbound DNS server configurationREADME.md
: This documentation file
To install, run the install.sh
script:
- Checks and installs Docker and Docker Compose if needed
- Creates
.env
file for environment variables - Generates a random PASSWORD and saves it to
.env
- Writes the current timezone
TZ
to.env
- Starts
docker-compose
to deploy containers
After installation, save the generated PASSWORD from the .env
file.
After running the installation script, containers are deployed using docker-compose
.
To check the IP address of the Shadowsocks server, use:
curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
Configure your browser or app with the following settings:
SOCKS5 proxy IP: [Shadowsocks server IP] Port: 1080 Use the saved PASSWORD.
docker-compose.yml Describes containers:
- unbound: Unbound DNS server using configuration from unbound/unbound.conf
- pihole: Pi-hole container for ad blocking using Unbound as upstream DNS server
- shadowsocks: Shadowsocks tunnel container
- Starts automatically on docker-compose up
- Uses 10.2.0.50 address in the container network
- Opens ports 8388 TCP and UDP for tunneling traffic
- Uses volumes with sha:sha1 parameter for data integrity
- Uses Pi-hole and Unbound as DNS servers
Unbound DNS server configuration:
- Caches query responses with TTL up to 86400 seconds
- Listens for queries from local networks and Pi-hole on port 53
- Enables privacy settings: query minimization, aggressive negative caching, etc.
- Allows recursive queries only from local networks for security
- Uses DNS over TLS for forwarding queries to upstream servers (commented out)
- Remote control is disabled
This setup allows Unbound to accept queries from the local network, cache responses, and forward the rest via the encrypted SOCKS5 tunnel of Shadowsocks, bypassing blocks.