Go to file
ben df2b1dc9c7
ben/socat-dns-docker/pipeline/head This commit looks good Details
Schedule builds monthly
2024-12-15 14:55:52 +01:00
.gitignore initial commit 2022-10-13 00:29:14 +02:00
Dockerfile improve the readme 2022-10-17 23:53:39 +02:00
Jenkinsfile Schedule builds monthly 2024-12-15 14:55:52 +01:00
LICENSE initial commit 2022-10-13 00:29:14 +02:00
README.md improve the readme 2022-10-17 23:53:39 +02:00

README.md

socat-dns-docker

Build Status git github matrix BSD-3-Clause-No-Military-License

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