cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1626
Views
3
Helpful
8
Replies

how change google DNS server to openDNS using ip route

Samiullah Osman
Level 1
Level 1

Hi expert
I want to change google DNS server (8.8.8.8 and 8.8.4.4) to openDNS 208.67.222.222 for all my network. so I made this configuration in my router to forward all google DNS requests to openDNS servers.


# ip route 8.8.8.8 255.255.255.255 208.67.222.222


this configuration is in (show running) but it doesn`t seem in the routing table (show ip route)
how can I fix this?

 

8 Replies 8

marce1000
VIP
VIP

 

 - Check the sequence of the routing commands, perhaps the default route has higher priority , 

 M.



-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
    When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '

thanks a lot for your replay
defult route has administrative number of 10, while this static route has AD number of 1

SamiullahOsman_0-1683182091466.png

 

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @Samiullah Osman ,

>> I want to change google DNS server (8.8.8.8 and 8.8.4.4) to openDNS 208.67.222.222 for all my network

Then you need to change the DNS server settings on the router to achieve this.

your static route is not installed because the IP next-hop is not known to the router.

You would need another static route for host OpenDNS pointing to the ISP gateway, but even if the static route would be installed your DNS requests would be still sent to 8.8.8.8 .

This is why you need to change the DNS server settings on your router

Hope to help

Giuseppe

 

thanks a lot for your helpful advice
so can you please tell me how I can disable Google DNS in my entire network and use openDNS instead.

Hello @Samiullah Osman ,

refer to the following link

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipaddr_dns/configuration/15-mt/dns-15-mt-book/dns-config-dns.html

the key command is

ip name-server 208.67.222.222

you may need to remove the commands related to google servers with

no ip name-server 8.8.8.8

these commands are to be entered in global configuration mode.

if your router acts as a DHCP server you may need to update the configuration of DHCP address pools

Hope to help

Giuseppe

 

Thanks a lot for your help. I am learning from your messages.
I change the router ip name-server to 208.67.222.222 and remove google DNS server. but still, my router can receive google DNS server through ISP and ISP`s DHCP server.
I used
ip route 8.8.8.8 255.255.255.255 208.67.222.222
ip route 208.67.222.222 255.255.255.255 gig 0/1
and I totally lost my internet connection

can I use access list to forward all pakets comes for 8.8.8.8 to 208.67.222.222?

regards.

Hello @Samiullah Osman ,

>> but still, my router can receive google DNS server through ISP and ISP`s DHCP server.

So your WAN interface gi0/1 has a dynamic IP address and it gets dynamically from ISP's DCHP server .

As a result of this the Google DNS is sent to your router via DHCP.

And you have seen that this dynamic config is preferred over the static name  server settings ?

I mean do you see DNS requests sent from your router with destination = Google DNS or destination = OpenDNS ?

if it is the first case  I'm afraid there is little you can do.

A line with a static public IP address is more expensive but it could give you  the freedom to choice the DNS server.

Hope to help

Giuseppe

 

I think this is impossible to translate the destination IP address. same as we do with source addresses in NAT.
I researched a lot but can't find any thing to translate the destenation IP address.

Review Cisco Networking for a $25 gift card