When using DHCP Server and Client if the parameter use-peer-dns under ip dhcp-client is set to yes then primary-dns under /ip dns will change to DNS address given by DHCP Server.
If resolve-mode is remote-dns then DHCP, PPP, PPTP, L2TP, ISDN and PPPoE servers as DNS server address will specify the values listed under /ip dns, otherwise - server's own address.
[admin@MikroTik] ip dns> set primary-dns=159.148.60.2
[admin@MikroTik] ip dns> print
resolve-mode: remote-dns
primary-dns: 159.148.60.2
secondary-dns: 0.0.0.0
[admin@MikroTik] ip dns> .. dns-cache set enabled=yes
[admin@MikroTik] ip dns> print
resolve-mode: local-dns-cache
primary-dns: 159.148.60.2
secondary-dns: 0.0.0.0
[admin@MikroTik] ip dns>
You can see that resolve-mode has changed its value to local-dns-cache. It means
that from this moment domain names will be resolved using local DNS cache.
[admin@MikroTik] ip dns-cache> print
enabled: no
size: 256
primary-server: 0.0.0.0
secondary-server: 0.0.0.0
running: no
[admin@MikroTik] ip dns-cache>
DNS servers are queried by DNS cache in the following order (the ones which are 0.0.0.0 are skipped):
[admin@MikroTik] ip dns-cache> set enabled=yes primary-server=159.148.60.2
[admin@MikroTik] ip dns-cache> print
enabled: yes
size: 256
primary-server: 159.148.60.2
secondary-server: 0.0.0.0
running: yes
usage: 0 %
entries: 0
[admin@MikroTik] ip dns-cache>
[admin@MikroTik] ip dns-cache hosts> add name=admin.home.pc address=10.0.0.10 [admin@MikroTik] ip dns-cache hosts> print # ADDRESS NAME 0 10.0.0.10 admin.home.pc [admin@MikroTik] ip dns-cache hosts>
[admin@MikroTik] ip dns-cache> print
enabled: yes
size: 256
primary-server: 159.148.60.2
secondary-server: 0.0.0.0
running: yes
usage: 32 %
entries: 358
[admin@MikroTik] ip dns-cache> set enabled=no
[admin@MikroTik] ip dns-cache> print
enabled: no
size: 256
primary-server: 159.148.60.2
secondary-server: 0.0.0.0
running: no
[admin@MikroTik] ip dns-cache> flush
[admin@MikroTik] ip dns-cache> set enabled=yes
[admin@MikroTik] ip dns-cache> print
enabled: yes
size: 256
primary-server: 159.148.60.2
secondary-server: 0.0.0.0
running: yes
usage: 0 %
entries: 0
[admin@MikroTik] ip dns-cache>
http://www.freesoft.org/CIE/Course/Section2/3.htm
http://www.networksorcery.com/enp/protocol/dns.htm
http://www.ietf.org/rfc/rfc1035.txt?number=1035