modify update_config function to avoid nest if
change the dns data format to array