How to access my router from terminal?

I am a linux ubuntu user and want to access my router from a terminal and want to change the settings from there. I am asking this because my router web-interface don't provide me the option to change the DNS server IP address. Thank you