Community discussions

MikroTik App
 
alternativi_boy
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Tue Apr 01, 2008 8:39 pm

need help?

Tue Nov 03, 2009 1:03 pm

hello, i hav a link from my provider, but i want to change with another provider, so the problem is that my client use 1st provider dns, and 2nd provider have othe dns, so how can i redirect just in my mikrotik and client dont need to change..

Regards Hablaraim
 
User avatar
hilton
Long time Member
Long time Member
Posts: 634
Joined: Thu Sep 07, 2006 5:12 pm
Location: Jozi (aka Johannesburg), South Africa

Re: need help?

Wed Nov 04, 2009 2:00 pm

/ip firewall nat
chain=dstnat action=dst-nat to-addresses=1.2.3.4 (the ip of your new provider) to-ports=53 protocol=udp in-interface=local (or whatever your internal interface is called) dst-port=53
Or simply input the new provider's DNS settings directly into Miktotik and then alter the above rule to redirect to the router.
 
alternativi_boy
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Tue Apr 01, 2008 8:39 pm

Re: need help?

Wed Nov 04, 2009 10:38 pm

so if my second provider dns are 192.68.22.222 then in thi nat rule i have to do like this:

chain=dstnat action=dst-nat to-addresses=192.168.22.222 to-ports=53 protocol=udp in-interface=local dst-port=53

so it's not necessary to subscribe fist provider dns right?

if you can explain me cause i dont know what to do..


Best Regard hablilir
 
User avatar
hilton
Long time Member
Long time Member
Posts: 634
Joined: Thu Sep 07, 2006 5:12 pm
Location: Jozi (aka Johannesburg), South Africa

Re: need help?

Wed Nov 04, 2009 10:49 pm

Depends if your susbscribers DNS service is free or not.

Otherwise just use OpenDNS.

208.67.222.222
208.67.220.220
 
alternativi_boy
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Tue Apr 01, 2008 8:39 pm

Re: need help?

Tue Nov 24, 2009 12:07 am

helo everybody,

my clients use for example 192.168.1.1 dns and 192.168.1.2
so other provider have 182.168.1.1 and second 182.168.1.2, so how can i redirect dns in my mikrotik, cause i have much clients and i cant change every computer dns..

Thanks, Best regards...Muldahirr
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: need help?

Tue Nov 24, 2009 12:26 am

With a local DNS cache, you'd use the following to set up the router as a resolving with the DNS servers of the ISP:
/ip dns
set allow-remote-requests=yes
set primary-dns=ip.of.primary.dns
set secondary-dns=ip.of.secondary.dns
And then transparently redirect all DNS requests to the router itself:
/ip firewall nat
add chain=dstnat protocol=tcp dst-port=53 in-interface=local action=redirect to-ports=53
Additionally, if you're providing DHCP services, hand out your router IP for DNS.
 
User avatar
hilton
Long time Member
Long time Member
Posts: 634
Joined: Thu Sep 07, 2006 5:12 pm
Location: Jozi (aka Johannesburg), South Africa

Re: need help?

Tue Nov 24, 2009 8:57 am


And then transparently redirect all DNS requests to the router itself:
/ip firewall nat
add chain=dstnat protocol=tcp dst-port=53 in-interface=local action=redirect to-ports=53
You probably meant protocol UDP so note to Muldahir, change the dst-nat rule to reflect this.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: need help?

Tue Nov 24, 2009 4:16 pm

Oops, yes, of course. Thanks for catching that.