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 Kristinsson 2fa3073b4b
ben/socat-dns-docker/pipeline/head This commit looks good Details
improve the readme
5 months ago
.gitignore initial commit 5 months ago
Dockerfile improve the readme 5 months ago
Jenkinsfile improve the readme 5 months ago
LICENSE initial commit 5 months ago
README.md improve the readme 5 months ago

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