Last active
June 9, 2021 02:04
-
-
Save henri/4ba740660c6faeaedb9d4d281e5ad4e3 to your computer and use it in GitHub Desktop.
Ruby DNS Google Safe Search Rule Builder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# copyright 2021, henri shustak | |
# build google force safe search ruls for rubyDNS | |
google_domains = `curl https://www.google.com/supported_domains 2>> /dev/null | sed "s/^.//g"`.split("\n") | |
google_domains.each do | dom | | |
puts "" | |
puts "#match #{dom}" | |
puts "match(/^#{dom}$/, IN::A) do |transaction|" | |
puts " transaction.respond!(Name.create('forcesafesearch.google.com'), resource_class: IN::CNAME)" | |
puts "end" | |
puts "match(/^www.#{dom}$/, IN::A) do |transaction|" | |
puts " transaction.respond!(Name.create('forcesafesearch.google.com'), resource_class: IN::CNAME)" | |
puts "end" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment