Filled out all files for DNS. Ready for testing.

This commit is contained in:
2023-07-29 11:44:00 -07:00
parent d35e8d3bac
commit bcc914d77a
7 changed files with 90 additions and 7 deletions

3
.gitignore vendored
View File

@@ -24,3 +24,6 @@ private.key
# Ignore secrets for Invidious. # Ignore secrets for Invidious.
Config/Invidious/*.env Config/Invidious/*.env
# Ignore DNS config files, contain private settings.
Config/DNS/config/*

View File

@@ -1,9 +1,10 @@
# 2023-07-29 # 2023-07-29
# Create website in node container and run it. #
# Create a Debian container which runs dnsmasq.
# https://wiki.debian.org/dnsmasq
#
# Using Debian testing so that we use PHP >8. Otherwise the shebangs from FROM debian
# the include files (#!/usr/bin/php) show up on the website.
FROM debian:testing
# Install Dependencies # Install Dependencies
RUN apt update && apt install -y dnsmasq RUN apt update && apt install -y dnsmasq

5
Config/DNS/README.md Normal file
View File

@@ -0,0 +1,5 @@
# Local DNS
Host a local DNS server in case your router/gateway is not cutting it. Allows
the ability to use simple names across the network witrhout editing `/etc/hosts`
on each machine. The IP of this server should be added to the router/gateway's
settings so that all machines on the network know to use it and can benefit.

View File

@@ -0,0 +1,31 @@
# 2023-07-29
#
# Description:
# Settings specific to DNS Masquerade. The parameters in this file are the
# same which can be passed to the dnsmasq program directly using '--', but the
# '--' is not necessary in this file. Otherwise this file has no manpage.
#
# Futher Reading:
# Commands:
# https://manpages.debian.org/bookworm/dnsmasq-base/dnsmasq.8.en.html
# Tutorials:
# Basic:
# https://www.howtoforge.com/how-to-setup-local-dns-server-using-dnsmasq-on-ubuntu-20-04/
# Split DNS:
# https://www.gluster.org/use-dnsmasq-for-separating-dns-queries/
# Who this server is.
port=53
domain=example.com
# FQDN must be provided in order for this server to check upstream for it.
domain-needed
# Do not forward requests for private IPs to upstream domains.
bogus-priv
# Automatically add FQDN to any simple names in /etc/hosts.
#expand-hosts
# Default cache size is 150. 0 disables caching. Large values lower performance.
cache-size=1000

View File

@@ -0,0 +1,20 @@
# 2023-07-29
#
# Description:
# Example file of how to use the hosts file. It contains local servers running
# inside the domain that need accessed directly rather than traversing outside
# the WAN. This saves time and prevents some routers from dropping data.
#
# Format:
# XXX.XXX.XXX.XXX subdomain.domain.extension subdomain
#
# Futher Reading:
# https://manpages.debian.org/bookworm/manpages/hosts.5.en.html
#
127.0.0.1 localhost
127.0.1.1 dns.example.com dns
192.168.1.22 ssh.example.com ssh
192.168.1.25 mail.example.com mail
192.168.1.80 www.example.com www

View File

@@ -0,0 +1,21 @@
# 2023-07-29
#
# Description:
# Generic DNS settings unrelated to dnsmasq are provided here.
#
# Futher Reading:
# https://manpages.debian.org/bookworm/manpages/resolv.conf.5.en.html
#
# The local domains being hosted.
search example.com anotherdomain.com
# Explicitly set local caching with /etc/hosts on.
nameserver 127.0.0.1
# Add any extra settings.
options rotate
# Use Cloudflare for upstream DNS.
nameserver 1.1.1.1
nameserver 1.0.0.1

View File

@@ -1,13 +1,15 @@
# 2023-07-29 # 2023-07-29
#
# Local DNS server which properly handles DNS splitting. # Local DNS server which properly handles DNS splitting.
# Necessary when using junk ISP gateways and running a domain. # Necessary when using junk ISP gateways and running a domain.
# https://wiki.debian.org/dnsmasq # https://thekelleys.org.uk/dnsmasq/doc.html
#
version: '3' version: '3'
services: services:
app: app:
restart: always
build: ./ build: ./
restart: always
ports: ports:
- 8317:8080 - "53:53"