Dynamic (DHCP) DNS problem
Posted: Tue Dec 05, 2017 7:09 pm
The issue:
DNS client can't automatically re-connect to new dynamic server(s) after router had been re-configured from static IP to DHCP internet connection.
Restart can't help on any of the steps described below.
I connected to new internet provider.
Then I had to reconfigure internet interface from static IP to DHCP mode.
All settings were successfully completed, except DNS option 'servers'.
Problem #1:
Router hasn't copied DNS address(es) received from DHCP server to DNS property 'servers'.
Such the behaviour is described in online Manual (see 2-nd, then 1-st Notes).
Instead, dynamic (new) address appeared in field 'dynamic-servers', while the field 'servers' remained with (old) addresses of previous ISP.
Details:
My property 'use-peer-dns' under /ip dhcp-client is set to 'yes'.
Conclusion:
Most probable, that page in online user manual is outdated.
Problem #2:
I wanted to remove all old settings from my router.
After I have set 'servers' to its default value "0.0.0.0", my internet browser said "Server not found" on known pages.
Problem was fixed when I had manually configured new DNS addresses received from DHCP server in field 'servers'.
Conclusion:
Property 'servers' has precedence over property 'dynamic-servers', even though property 'use-peer-dns' under /ip dhcp-client is set to 'yes'.
Most probable, router continue to use old DNS server(s) after new ones were assigned by DHCP.
Option 'dynamic-servers' is never actual.
Workaround/Fix:
Set new DNS servers manually. Duplicate settings (see below).
About NTP:
NTP client also has options for both statically defined and dynamically obtained servers -
'primary-ntp', 'secondary-ntp' and 'dynamic-servers'.
After I had configuration completed, the field 'dynamic-servers' was set automatically by router.
Static servers had old settings. So, I manually set them to default value "0.0.0.0".
NTP client works without problem when properties primary-ntp="0.0.0.0" and secondary-ntp="0.0.0.0" unlike DNS.
My router data (selected):
/system routerboard print
model: 951G-2HnD
firmware-type: ar9344
current-firmware: 3.41
/system package update print
channel: current
installed-version: 6.40.5
/ip dhcp-client print detail
use-peer-dns=yes
use-peer-ntp=yes
status=bound
primary-dns=195.62.128.130
secondary-dns=77.38.238.2
# After DHCP configuration. DNS is working (with old servers?)
/ip dns print
servers: 217.199.126.2,91.198.156.20
dynamic-servers: 195.62.128.130,77.38.238.2
allow-remote-requests: yes
# After DNS 'servers' was setted to "0.0.0.0". DNS is not working.
/ip dns print
servers: 0.0.0.0
dynamic-servers: 195.62.128.130,77.38.238.2
# After DNS 'servers' was setted manually. DNS is working.
/ip dns print
servers: 195.62.128.130,77.38.238.2
dynamic-servers: 195.62.128.130,77.38.238.2
DNS client can't automatically re-connect to new dynamic server(s) after router had been re-configured from static IP to DHCP internet connection.
Restart can't help on any of the steps described below.
I connected to new internet provider.
Then I had to reconfigure internet interface from static IP to DHCP mode.
All settings were successfully completed, except DNS option 'servers'.
Problem #1:
Router hasn't copied DNS address(es) received from DHCP server to DNS property 'servers'.
Such the behaviour is described in online Manual (see 2-nd, then 1-st Notes).
Instead, dynamic (new) address appeared in field 'dynamic-servers', while the field 'servers' remained with (old) addresses of previous ISP.
Details:
My property 'use-peer-dns' under /ip dhcp-client is set to 'yes'.
Conclusion:
Most probable, that page in online user manual is outdated.
Problem #2:
I wanted to remove all old settings from my router.
After I have set 'servers' to its default value "0.0.0.0", my internet browser said "Server not found" on known pages.
Problem was fixed when I had manually configured new DNS addresses received from DHCP server in field 'servers'.
Conclusion:
Property 'servers' has precedence over property 'dynamic-servers', even though property 'use-peer-dns' under /ip dhcp-client is set to 'yes'.
Most probable, router continue to use old DNS server(s) after new ones were assigned by DHCP.
Option 'dynamic-servers' is never actual.
Workaround/Fix:
Set new DNS servers manually. Duplicate settings (see below).
About NTP:
NTP client also has options for both statically defined and dynamically obtained servers -
'primary-ntp', 'secondary-ntp' and 'dynamic-servers'.
After I had configuration completed, the field 'dynamic-servers' was set automatically by router.
Static servers had old settings. So, I manually set them to default value "0.0.0.0".
NTP client works without problem when properties primary-ntp="0.0.0.0" and secondary-ntp="0.0.0.0" unlike DNS.
My router data (selected):
/system routerboard print
model: 951G-2HnD
firmware-type: ar9344
current-firmware: 3.41
/system package update print
channel: current
installed-version: 6.40.5
/ip dhcp-client print detail
use-peer-dns=yes
use-peer-ntp=yes
status=bound
primary-dns=195.62.128.130
secondary-dns=77.38.238.2
# After DHCP configuration. DNS is working (with old servers?)
/ip dns print
servers: 217.199.126.2,91.198.156.20
dynamic-servers: 195.62.128.130,77.38.238.2
allow-remote-requests: yes
# After DNS 'servers' was setted to "0.0.0.0". DNS is not working.
/ip dns print
servers: 0.0.0.0
dynamic-servers: 195.62.128.130,77.38.238.2
# After DNS 'servers' was setted manually. DNS is working.
/ip dns print
servers: 195.62.128.130,77.38.238.2
dynamic-servers: 195.62.128.130,77.38.238.2