Get or Set Primary or Secondary DNS (Domain Name Server) IP addresses.
The runtime DNS server settings could be set by several methods. They could be set manually or set by DHCP process. The following rules give how firmware maintains the runtime DNS server settings.
- There is no valid setting in DNS_PRIMARY and DNS_SECONDARY
- Runtime DNS server settings will be updated by DHCP process. The return of WAN_STATUS shows these runtime DNS server settings
- The return message of DNS_PRIMARY, DNS_SECONDARY is still NULL even the runtime DNS server settings were updated by DHCP process
- There are valid settings in DNS_PRIMARY or DNS_SECONDARY
- Runtime DNS server settings were set by DNS_PRIMARY and DNS_SECONDARY configurations. DHCP process will NOT affect the runtime DNS server settings.
- When the settings in DNS_PRIMARY and DNS_SECONDARY were removed, firmware loads the DNS server settings acquired from DHCP process to runtime DNS server settings.
If the CHANNEL=n was set with this URL to the multiple channel video encoders, this URL is treated as read command and the router's DNS configurations will be returned.
Unicast IPv4 Addressing (xxx.xxx.xxx.xxx)
Note:
When set 0.0.0.0, the firmware removes the DNS server settings. For example,
The DNS_PRIMARY=0.0.0.0 and DNS_PRIMARY= could remove the primary DNS server setting from firmware
But the return message of them are different.
OK: DNS_PRIMARY='0.0.0.0' is the return message of the first command and DNS_PRIMARY='' is the return message of the second command.
After these two commands, the DNS_PRIMARY configuration in firmware will be DNS_PRIMARY=''.
DNS_PRIMARY='168.95.1.1'
DNS_SECONDARY=''
OK: DNS_PRIMARY='168.95.1.1'
OK: DNS_SECONDARY=''
or
ERROR: DNS_PRIMARY='168.95.1.1'
ERROR: DNS_SECONDARY=''
Valid
http://ip:port/cgi-bin/system?USER=Admin&PWD=123456&DNS_PRIMARY
http://ip:port/cgi-bin/system?USER=Admin&PWD=123456&DNS_SECONDARY
or
http://ip:port/cgi-bin/cmd/system?DNS_PRIMARY
http://ip:port/cgi-bin/cmd/system?DNS_SECONDARY
http://ip:port/cgi-bin/system?USER=Admin&PWD=123456&DNS_PRIMARY='168.95.1.1'
http://ip:port/cgi-bin/system?USER=Admin&PWD=123456&DNS_SECONDARY=''
or
http://ip:port/cgi-bin/cmd/system?DNS_PRIMARY='168.95.1.1'
http://ip:port/cgi-bin/cmd/system?DNS_SECONDARY=''