/ip route add dst-address=[:resolve facebook.com ] gateway=192.168.77.1 scope=10
This is true, but does not tell which dns server is resolving, which can be helpful...to find out the IP address of some domain, just ping it. or you can use the ":resolve" command, if you need it in scripts:
ros code
[admin@MikroTik] > put [:resolve mt.lv] 159.148.147.196
/ip route check dst-ip=10.4.0.0 once
status: ok interface: ether4-WT_5AC nexthop: 10.251.250.4
{ :local gatewayWT [/ip address get [/ip route find gateway dst-address=10.4.0.0/16] ] :put $gatewayWT }
{ :local address1 [/ip address get [/interface ethernet find name=ether1] address] :put $address1 }
{ :local address1 [/ip address get [find interface="ether1"] address] :put $address1 } invalid internal item number