dnsmasq
container is testing successfully now.
This commit is contained in:
@@ -2,20 +2,25 @@
|
||||
#
|
||||
# Create a Debian container which runs dnsmasq.
|
||||
# https://wiki.debian.org/dnsmasq
|
||||
# https://computingforgeeks.com/run-and-use-dnsmasq-in-docker-container/?expand_article=1
|
||||
#
|
||||
|
||||
FROM debian
|
||||
|
||||
# Remove Existing Config
|
||||
RUN rm -rfv /etc/{hosts,resolv.conf,dnsmasq.conf}
|
||||
|
||||
# Install Dependencies
|
||||
RUN apt update && apt install -y dnsmasq
|
||||
RUN apt-get update && apt-get install -y dnsmasq vim inetutils-ping
|
||||
|
||||
# Copy Configuration Files
|
||||
COPY ./config/hosts /etc/
|
||||
COPY ./config/resolv.conf /etc/
|
||||
COPY ./config/dnsmasq.conf /etc/
|
||||
RUN mkdir -pv /etc/dnsmasq
|
||||
COPY ./config/hosts /etc/dnsmasq/hosts
|
||||
COPY ./config/resolv.conf /etc/dnsmasq/resolv.conf
|
||||
COPY ./config/dnsmasq.conf /etc/dnsmasq/dnsmasq.conf
|
||||
|
||||
## Reload Service
|
||||
RUN service dnsmasq restart
|
||||
# Stop Default Service
|
||||
RUN service dnsmasq stop
|
||||
|
||||
# Load Specific Config Files
|
||||
CMD dnsmasq -k --log-facility=- --log-queries=extra \
|
||||
--conf-file=/etc/dnsmasq/dnsmasq.conf \
|
||||
--no-hosts --addn-hosts=/etc/dnsmasq/hosts \
|
||||
--resolv-file=/etc/dnsmasq/resolv.conf
|
||||
|
@@ -10,11 +10,11 @@
|
||||
# The local domains being hosted.
|
||||
search example.com anotherdomain.com
|
||||
|
||||
# Explicitly set local caching with /etc/hosts on.
|
||||
# Explicitly set local caching with hosts file on.
|
||||
nameserver 127.0.0.1
|
||||
|
||||
# Add any extra settings.
|
||||
options rotate
|
||||
#options rotate
|
||||
|
||||
# Use Cloudflare for upstream DNS.
|
||||
nameserver 1.1.1.1
|
||||
|
@@ -10,14 +10,7 @@ version: '3'
|
||||
services:
|
||||
app:
|
||||
build: ./
|
||||
restart: on-failure
|
||||
restart: always
|
||||
ports:
|
||||
- "53:53"
|
||||
command: |
|
||||
/bin/sh -c '
|
||||
while :
|
||||
do
|
||||
sleep 8h & wait $${!}
|
||||
service dnsmasq restart
|
||||
done
|
||||
'
|
||||
- "53:53/udp"
|
||||
- "53:53/tcp"
|
||||
|
@@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# 2023-07-29
|
||||
# Config/DNS/run.sh
|
||||
# Fix common issues when trying to run this container.
|
||||
@@ -16,7 +18,7 @@ function stop-service {
|
||||
fi
|
||||
systemctl disable --now $service &&
|
||||
echo "$service stopped successfully!" ||
|
||||
echo "$service was not found, no problem."
|
||||
echo "* If $service was not found then there is no problem."
|
||||
}
|
||||
|
||||
echo -e "\n*** Turn off any local DNS programs ***"
|
||||
|
@@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# 2023-07-29
|
||||
# Config/DNS/undo.sh
|
||||
# Easy way to stop using this container.
|
||||
@@ -16,7 +18,7 @@ function start-service {
|
||||
fi
|
||||
systemctl enable --now $service &&
|
||||
echo "$service started successfully!" ||
|
||||
echo "$service was not found, no problem."
|
||||
echo "* If $service was not found then there is no problem."
|
||||
}
|
||||
|
||||
echo -e "\n*** Stop the docker container ***"
|
||||
|
Reference in New Issue
Block a user