![]() Announcements of new products in EA (Early Access) and GA (General Availability).Information you may have come across that could help others.Questions about problems you may have encountered with your product(s). ![]() This is a place to discuss all of Ubiquiti's products, such as the EdgeRouter, UniFi, AirFiber, etc. (crontab -l echo "20 4 * * * /root/update-adblock-dnsmasq.Welcome to the unofficial Ubiquiti Subreddit! Then add the script to crontab.Ĭontab will generate a new blocklist everyday from your blocklist sources. Make sure no errors were written to the console. sudo chmod a x ~/update-adblock-dnsmasq.sh Make sure you're root, chmod the script, and run the script. Save the bash file by hitting escape, ':wq', and enter. Sed -i "s/$/\/$blackhole_ip/" $tmp_blocklist # Add to end of all lines: '/$blackhole_ip' # Remove any comment lines/lines containing '#' # You could use regex matches to make this prettier and more flexible.įor i in -s "$i" | sed "s/0\.0\.0\.0 //" > $tmp_blocklist # Make sure we're starting with empty blocklists # Block configuration to be used by dnsmasqīlocklist="/etc/dnsmasq.d/nf" MUST NOT be sent, except as a source address as part of an initialization procedure by which the host learns its own IP address." Per RFC 1122, section 3.2.1.3 "This host on this network. # Blackhole/IP to respond to DNS query if domain is on blocklist If you change blocklists you need to change the code. # NB: the script implies blocklists use 0.0.0.0 as the blackhole IP. Paste the following to the bash script #!/bin/bash Switch to the root user and create a bash script with vi in root home directory. Total DNS entries inserted into cache: 1381ĭNS entries removed from cache before expiry: 0 Afterwards show DNS statistics show dns forwarding statistics Nameservers configured for DNS forwardingġ.1.1.1 available via 'optionally configured'ġ.0.0.1 available via 'optionally configured'Ģ08.67.222.222 available via 'optionally configured'Ģ08.67.220.220 available via 'optionally configured' 118.3 Validate configurationĬheck the correct forwarding nameservers are used show dns forwarding nameservers Make DHCP clients use EdgeRouter as DNS server set service dhcp-server shared-network-name LAN subnet 192.168.1.0/24 dns-server 192.168.1.1Ĭommit and save the new config. Using 'except-interface' setting allows incoming queries from all other interfaces set service dns forwarding except-interface eth0įorward unknown/uncached DNS queries to the EdgeRouter system DNS servers set service dns forwarding system ![]() Set eth0 to not listen for DNS queries coming from your ISP or the internet. This will remove the ISP DNS servers from EdgeRouter system run renew dhcp interface eth0Įnable DNS server with DNS forwarding on EdgeRouterīased on Ubiquiti guide to setup EdgeRouter as DNS server with forwarding enabled.Įnable DNS cache ( EdgeRouter forum post discussing cache sizes) set service dns forwarding cache-size 3000 Stop EdgeRouter from adding extra system DNS servers from eth0 DHCP (the ones your ISP wants you to use) set interfaces ethernet eth0 dhcp-options name-server no-update I'm using Cloudflare and OpenDNS set system name-server set system name-server set system name-server set system name-server 208.67.222.222 The system DNS servers will later be used for DNS forwarding. EdgeRouter is using firmware 1.9.7 or higher (to use 'forwarding except-interface' instead of 'forwarding listen-on')Ĭonnect to EdgeRouter and set system DNS serversĮnter configure mode and set system nameservers.EdgeRouter has a DHCP server named 'LAN' with subnet '192.168.1.0/24' and router IP '192.168.1.1' (default ERX config). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |