You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ben/socat-dns-docker/pipeline/head This commit looks good
Details
|
5 months ago | |
---|---|---|
.gitignore | 5 months ago | |
Dockerfile | 5 months ago | |
Jenkinsfile | 5 months ago | |
LICENSE | 5 months ago | |
README.md | 5 months ago |
README.md
socat-dns-docker
use socat
to forward to the
dns server of a bridged docker network.
this is a pretty simple docker image. you can simply clone this repo and build the container:
docker build -t socat-dns:latest
# run the container
network="bridge"
container_ip="172.17.0.10"
docker run -d --rm -it \
--network="$network" \
--ip "$container_ip"
--name socatdns -p 127.0.0.1:53:5353 \
socat-dns:latest
then you can send a query to container from the host:
$ dig socatdns @172.17.0.10 -p 5353 +short
172.17.0.10
or use the port forwarded to loclahost
:
$ dig socatdns @127.0.0.1 +short
177.17.0.10
examples
use the pre-built container with a docker-compose.yml
file:
version: '3'
services:
socatdns:
image: git.sudo.is/ben/socat-dns:latest
container_name: socatdns
restart: always
ports:
- 127.0.0.1:5353:53