special dns resolving

Hy!

It will be very helpful, when the main link is down the user will be inform about this.
The idea is:
When the link is down redirect all tcp 80 to a local web server. → “The link is down, sorry”
This workin’ now, but only from cached sites, because when the client browser don’t know the wanted site’s IP then make a dns query.
Oops, the dns server is on the other side of the broken link! Then the browser say: sorry, can’t find web page…
In this case MT must be answer to the dns query. Ok, but how? It’s impossible to cache all domain name…
Have YOU any idea?
(Or please make a tiny webserver to the MT :slight_smile: )

You can set a static dns:

/ ip dns static
add name=“webserver.yourdomain.com” address=192.168.1.50 ttl=1d

And… set in the clients dns server with the MikroTik webproxy IP address. But I don´t know how redirect when the link is down (script?).

This work for you?

It’s impossible to add all domain name in the world to static dns :slight_smile:
So I need that the MT say to all domain that the requested name’s ip is (for example) 192.168.1.1

Why is impossible?


/ ip dns static 
add name="mail.cgp.gba.gov.ar" address=10.10.128.194 ttl=1d

Z:>ping mail.cgp.gba.gov.ar

Haciendo ping a mail.cgp.gba.gov.ar [10.10.128.194] con 32 bytes de datos:

Respuesta desde 10.10.128.194: bytes=32 tiempo<1m TTL=128
Respuesta desde 10.10.128.194: bytes=32 tiempo<1m TTL=128
Respuesta desde 10.10.128.194: bytes=32 tiempo<1m TTL=128
Respuesta desde 10.10.128.194: bytes=32 tiempo<1m TTL=128

Estadísticas de ping para 10.10.128.194:
    Paquetes: enviados = 4, recibidos = 4, perdidos = 0
    (0% perdidos),
Tiempos aproximados de ida y vuelta en milisegundos:
    Mínimo = 0ms, Máximo = 0ms, Media = 0ms

Because there are very very very many domain names!
I don’t like and don’t know add all domains on the internet :slight_smile:

you can use /tool netwatch to check if link is down, if it is down, redirect all port 80 traffic to your local webserver.

I think YOU don’t understand the problem!
The problem is when the main link is down there is no dns resolving too!!!
You can redirect all (web) traffic, but the browsers need FIRST(!!!) resolve the wanted domain IP.
Because the link is down there is no dns server. When no dns server browser can’t generate any web traffic (what like redirect… ) because don’t know the wanted server ip address.
Transparent proxy also working not, because the first step is resolving, when you don’t use proxy on your browser.

Well I understood it exactly as you said. You want to check if your main link is down? Then you can do it with netwatch and you don’t need DNS resolving for that.

What need I do with netwatch? Redirect 80 tcp is okay, but the client need first dns resolving…
I think you understand still not

If you don’t believe for me try it yourself! Redirect all tcp 80 port to the MT’s IP and try open a webpage. For example http://www.mikrotik.com
You will see on the explorer status bar: searching site http://www.mikrotik.com
Thay you will se an error message, not the MT’s default page. But when you add static dns http://www.mikrotik.com than you will see the MT’s defalt page.
Try it!

ps.: before try please empty all cache of the browser and make an ipconfig /flushdns too!
(because when the ip-domain pair is on the cache the browser don’t make dns resolving and the redirect will workin’)

Then the question is do you want to check if your main link is down or link to specific web page is down?

The last! Redirect to a local webserver (because MT has no user manageable web server) to inform user’s.
(Local webserver connect to MT with cable and hasn’t dns server, because it’s a simple webserver hardware by PIC microcontroller)

In that case, as far as I know, it is not possible.

Other option is to use webproxy. If web proxy is enabled and page is not accessible then internal information page will be displayed that gateway timed out ( these web pages are not editable ).
I know it’s not exactly as you want, but still something.

I am understand your problem.
I am also suffering from this problem.
One of my friend told me to redirect all http to a local web-server (which is listing 80, with a error message like: “Link is Down.”).
But this redirection is not working (So, user not getting any message from that local web-server “Link is Down.”).

If anyone know the solution… please Help!!!

Why do you need that anyway? Are your clients so stupid if they don’t know that host could be temporarily unavailable?

Can you imagine it how much disturbing, when you work meanwhile continuous your telephone rings?
Because the user don’t know why can’t browsing web sites. So the best reason for he is call me…
Then I must to decide that work or phone…

To me the logical solution is you need to setup a wildcard dns server & a web server to host your “the link is down” page.
Then use netwatch to redirect both DNS & Web to that server when the link is down, and then disable those rules when the link comes back up.

-Louis

add DNS records for main search engines, like MSN Search =) when Internet Explorer cannot obtain address of some website, it redirects your request to the search page - voilà! now you can redirect it to your webpage =)

Often the plainest solution the the best!
It’s a very good idea. I add the frequentest starting sheets to it and the users’ big part will be informed.

Have you idea how can I set up a wildcard dns server in the mikrotik?

It can’t be done in a Mikrotik to my knowlege. Whichever os you are using to host your “the link is down page”, you should setup DNS service with wildcard.

-Louis