/
/
/
1# ==============================================================================
2# Pi-hole Custom Configuration
3# ==============================================================================
4#
5# Description: Custom DNSMasq configuration for Pi-hole
6# Generated by Ansible - DO NOT EDIT MANUALLY
7# Template: pihole-custom.conf.j2
8#
9# This file is automatically included by Pi-hole's dnsmasq configuration
10# Place in: {{ docker_base_path }}/pihole/dnsmasq.d/
11#
12# ==============================================================================
13
14# ========================================================================
15# CUSTOM DNS RECORDS
16# ========================================================================
17
18# Local domain records - add your local network devices here
19# Format: address=/hostname.domain/IP-address
20
21# Example local devices
22# address=/router.local/192.168.1.1
23# address=/nas.local/192.168.1.10
24# address=/printer.local/192.168.1.20
25
26# ========================================================================
27# CUSTOM DHCP OPTIONS (if DHCP enabled)
28# ========================================================================
29
30{% if pihole_dhcp_enabled %}
31# DHCP scope configuration
32# dhcp-range=192.168.1.100,192.168.1.200,255.255.255.0,24h
33
34# DHCP options
35# dhcp-option=3,192.168.1.1 # Default gateway
36# dhcp-option=6,192.168.1.1 # DNS server
37# dhcp-option=15,local # Domain name
38
39# Static DHCP leases
40# dhcp-host=AA:BB:CC:DD:EE:FF,192.168.1.50,server,24h
41{% endif %}
42
43# ========================================================================
44# DNS CUSTOMIZATIONS
45# ========================================================================
46
47# Force DNS queries to use TCP (helpful for some networks)
48# all-servers
49
50# Increase DNS cache size for better performance
51# cache-size=10000
52
53# Local domain for DHCP clients
54# domain=local
55
56# ========================================================================
57# BLOCKING ENHANCEMENTS
58# ========================================================================
59
60# Additional blocklists (beyond Pi-hole's default)
61# addn-hosts={{ docker_base_path }}/pihole/config/custom-blocklist.txt
62
63# Force safe search for popular search engines
64# safesearch.google.com=216.239.38.120
65# safesearch.youtube.com=216.239.38.120
66# safesearch.bing.com=204.79.197.220
67
68# ========================================================================
69# PERFORMANCE OPTIMIZATIONS
70# ========================================================================
71
72# DNS query timeout (milliseconds)
73# query-timeout=5000
74
75# Maximum number of concurrent DNS queries
76# dns-forward-max=150
77
78# ========================================================================
79# LOGGING CONFIGURATION
80# ========================================================================
81
82# Enable detailed logging (useful for debugging)
83# log-queries
84# log-dhcp
85
86# ========================================================================
87# CUSTOM FORWARDING RULES
88# ========================================================================
89
90# Forward specific domains to different DNS servers
91# server=/example.com/8.8.8.8
92# server=/internal.company/192.168.1.53
93
94# ========================================================================
95# SECURITY SETTINGS
96# ========================================================================
97
98# Prevent DNS rebinding attacks
99# stop-dns-rebind
100
101# Filter private IP addresses in responses
102# filter-private-ip
103
104# ========================================================================
105# LOCAL CACHE OPTIMIZATIONS
106# ========================================================================
107
108# Local-ttl for overriding TTL values
109# local-ttl=300
110
111# Negative cache TTL
112# neg-ttl=60
113
114# ========================================================================
115# ADVANCED CUSTOMIZATIONS
116# ========================================================================
117
118# Enable DNSSEC validation
119# dnssec
120# trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D
121
122# EDNS payload size
123# edns-packet-max=1232
124
125# ========================================================================
126# CUSTOM SCRIPTS AND HOOKS
127# ========================================================================
128
129# Execute scripts on DHCP events
130# dhcp-script={{ docker_base_path }}/pihole/scripts/dhcp-hook.sh
131
132# ========================================================================
133# CONDITIONAL FORWARDING (if needed)
134# ========================================================================
135
136{% if pihole_conditional_forwarding %}
137# Conditional forwarding for local domain resolution
138# server=/local/192.168.1.1
139# server=/home/192.168.1.1
140{% endif %}
141
142# ==============================================================================
143# END OF PI-HOLE CUSTOM CONFIGURATION
144# ==============================================================================