Community discussions

MikroTik App
 
amtisrac
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 98
Joined: Mon Jun 13, 2005 10:53 am
Location: Hungary

special dns resolving

Fri Oct 05, 2007 5:07 pm

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 :) )
 
User avatar
Viroslash
Frequent Visitor
Frequent Visitor
Posts: 75
Joined: Wed Jun 20, 2007 5:39 am
Location: La Plata, Buenos Aires, Argentina
Contact:

Re: special dns resolving

Fri Oct 05, 2007 8:06 pm

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?
 
amtisrac
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 98
Joined: Mon Jun 13, 2005 10:53 am
Location: Hungary

Re: special dns resolving

Mon Oct 08, 2007 2:32 pm

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 :)
So I need that the MT say to all domain that the requested name's ip is (for example) 192.168.1.1
 
User avatar
Viroslash
Frequent Visitor
Frequent Visitor
Posts: 75
Joined: Wed Jun 20, 2007 5:39 am
Location: La Plata, Buenos Aires, Argentina
Contact:

Re: special dns resolving

Mon Oct 08, 2007 2:49 pm

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
 
amtisrac
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 98
Joined: Mon Jun 13, 2005 10:53 am
Location: Hungary

Re: special dns resolving

Mon Oct 08, 2007 3:04 pm

Why is impossible?
Because there are very very very many domain names!
I don't like and don't know add all domains on the internet :)
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7187
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: special dns resolving

Mon Oct 08, 2007 3:07 pm

you can use /tool netwatch to check if link is down, if it is down, redirect all port 80 traffic to your local webserver.
 
amtisrac
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 98
Joined: Mon Jun 13, 2005 10:53 am
Location: Hungary

Re: special dns resolving

Mon Oct 08, 2007 3:23 pm

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.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7187
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: special dns resolving

Mon Oct 08, 2007 3:51 pm

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.
 
amtisrac
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 98
Joined: Mon Jun 13, 2005 10:53 am
Location: Hungary

Re: special dns resolving

Mon Oct 08, 2007 4:16 pm

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')
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7187
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: special dns resolving

Mon Oct 08, 2007 4:28 pm

Then the question is do you want to check if your main link is down or link to specific web page is down?
 
amtisrac
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 98
Joined: Mon Jun 13, 2005 10:53 am
Location: Hungary

Re: special dns resolving

Mon Oct 08, 2007 5:05 pm

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)
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7187
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: special dns resolving

Mon Oct 08, 2007 5:21 pm

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.
 
chap
Frequent Visitor
Frequent Visitor
Posts: 51
Joined: Sun Dec 24, 2006 8:30 am

Re: special dns resolving

Mon Oct 08, 2007 5:34 pm

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!!!
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7187
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: special dns resolving

Mon Oct 08, 2007 5:40 pm

Why do you need that anyway? Are your clients so stupid if they don't know that host could be temporarily unavailable?
 
amtisrac
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 98
Joined: Mon Jun 13, 2005 10:53 am
Location: Hungary

Re: special dns resolving

Mon Oct 08, 2007 7:37 pm

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...
 
User avatar
Letni
Member
Member
Posts: 376
Joined: Tue Dec 05, 2006 5:16 am
Location: South Carolina

Re: special dns resolving

Mon Oct 08, 2007 9:10 pm

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
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: special dns resolving

Tue Oct 09, 2007 1:54 am

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 =)
 
amtisrac
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 98
Joined: Mon Jun 13, 2005 10:53 am
Location: Hungary

Re: special dns resolving

Tue Oct 09, 2007 2:36 pm

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.
 
amtisrac
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 98
Joined: Mon Jun 13, 2005 10:53 am
Location: Hungary

Re: special dns resolving

Tue Oct 09, 2007 2:38 pm

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
Have you idea how can I set up a wildcard dns server in the mikrotik?
 
User avatar
Letni
Member
Member
Posts: 376
Joined: Tue Dec 05, 2006 5:16 am
Location: South Carolina

Re: special dns resolving

Tue Oct 09, 2007 3:10 pm

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
 
amtisrac
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 98
Joined: Mon Jun 13, 2005 10:53 am
Location: Hungary

Re: special dns resolving

Tue Oct 09, 2007 3:29 pm

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
This is an PIC based (microcontroller) web server without any other services... :/
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: special dns resolving

Fri Oct 19, 2007 12:49 pm

What's new in 3.0rc7:
*) added regular expression matching to dns resolver static entries;

Who is online

Users browsing this forum: surek and 23 guests