Community discussions

MikroTik App
 
Rivera
Member Candidate
Member Candidate
Topic Author
Posts: 105
Joined: Thu Jul 21, 2011 7:42 pm

DNS-based routing?

Tue Nov 15, 2011 2:13 pm

Hello. Since some services available only in USA (for example - pandora), i want to use VPN tunnel with USA IP address.
The problem is i can't find any way to do DNS-based routing (example - *.pandora.com via ovpn-out-usa).
I can setup ip-based routing, but pandora uses many IPs - some for website, and some for media servers, and they changing.
Any way to do that?

UPD: Oh, pandora owns a netblock, so i can route some.net/24 via my vpn. But i still interested if it possible to do dns-based routing.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: DNS-based routing?

Tue Nov 15, 2011 2:44 pm

You can't do DNS based routing on RouterOS.
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: DNS-based routing?

Tue Nov 15, 2011 2:57 pm

I would imagine that scripting would cover this easily.

Create a script that pulls the A records of the domain you want and puts them into the appropriate routes.

You can schedule the script to run every 12 hours, so it will be semi-dynamic.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: DNS-based routing?

Tue Nov 15, 2011 3:18 pm

The built in resolver only returns one A record.

You could do this with an external box checking IP space and making API calls. If you're using NAND based routers keep in mind that this could cause a huge amount of write cycles to NAND depending on how many API calls you make to update address lists (that's the primary reason many people have asked for truly dynamic address lists you can manually add to).
 
cieplik206
Trainer
Trainer
Posts: 290
Joined: Sun Jul 01, 2007 12:25 am
Contact:

Re: DNS-based routing?

Tue Nov 15, 2011 4:10 pm

root@alpha:/var/log/apache2# dig www.pandora.com

; <<>> DiG 9.7.3 <<>> www.pandora.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49685
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 13, ADDITIONAL: 0

;; QUESTION SECTION:
;www.pandora.com. IN A

;; ANSWER SECTION:
www.pandora.com. 2250 IN A 208.85.40.80
www.pandora.com. 2250 IN A 208.85.40.20
www.pandora.com. 2250 IN A 208.85.40.50



and you have all addresses
 
Rivera
Member Candidate
Member Candidate
Topic Author
Posts: 105
Joined: Thu Jul 21, 2011 7:42 pm

Re: DNS-based routing?

Tue Nov 15, 2011 6:21 pm

NetRange: 208.85.40.0 - 208.85.47.255
CIDR: 208.85.40.0/21
OriginAS: AS40428

I know i can do ip routes, my question was about DNS-based routing.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: DNS-based routing?

Sun Nov 20, 2011 2:40 pm

The built in resolver only returns one A record.
..., but in round-robin manner :)
I know i can do ip routes, my question was about DNS-based routing.
not possible. many hundreds (thousands?) DNS queries per second will kill either your router or your DNS server :) the rest can be solved by scripting and address-lists
 
mehrdad22
just joined
Posts: 1
Joined: Fri Jan 18, 2019 10:59 pm

Re: DNS-based routing?

Mon Jul 22, 2019 1:41 pm

I also have this request
For example, nadin-co.ir or youtube.com and many other domain access is due to restrictions through the US Tunnel
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: DNS-based routing?

Thu Jul 25, 2019 11:13 am

Just add necessary FQDNs to Firewall Address List and use that address list for policy routing.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 207 guests