forcesafesearch.google.com DNS entry

Hello,

First post here.

I am used to simply setting DNS entries using Windows. Example here:

http://www.avantiny.com/force-google-safe-search-with-this-simple-dns-modification/

However, I am not finding it as simple with MikroTik. Here is what I am trying to do:

To force SafeSearch for your network, you’ll need to update your DNS configuration. Set the DNS entry for > www.google.com > to be a CNAME for forcesafesearch.google.com.

https://support.google.com/websearch/answer/186669

How do I do this in MikroTik?

Thank you very much for the help

I have the same problem - does anyone know how to do this?

To force SafeSearch for your network, you’ll need to update your DNS configuration. Set the DNS entry for > www.google.com > to be a CNAME for forcesafesearch.google.com.

You may be tempted to add CNAME like this (it’s possible since RouterOS 6.47):

/ip dns static
add name=www.google.com type=CNAME cname=forcesafesearch.google.com

but as of today (I’m hoping it will change in future), whole CNAME support in RouterOS is pretty much useless and won’t do what you need.

But you can add static A record:

/ip dns static
add name=www.google.com address=216.239.38.120 ttl=5m comment=safesearch

And use this script in scheduler to update it in case it changes:

:local host "forcesafesearch.google.com"
:do {
  :local newip [:resolve $host]
  foreach i in=[/ip dns static find comment="safesearch"] do={
    if ($newip != [/ip dns static get $i address]) do={
      /ip dns static set $i address=$newip
      :log info ("dns record updated ($host = $newip)")
    }
  }
} on-error={
  :log info "unable to resolve $host"
}

Running it once per hour should be more than enough.