Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

Obtain DNS automatically from ISP by Cisco router 871

Hi,

I would like to obtain the DNS from ISP automatically.

I have the following DHCP configuration in my router :

ip dhcp pool guest

import all

network 192.168.123.0 255.255.255.0

default-router 192.168.123.1

and I added the following command on my Dialer interface :

ppp ipcp dns request

but still I do not get DNS. I can connect to Internet and ping a public address but can not browse.

Any idea please?

Thanks

Mehdi

8 REPLIES
Blue

Re: Obtain DNS automatically from ISP by Cisco router 871

! optional

[no ip domain-lookup]

[ip domain-name company.com]

! list your ISP DNS servers below

ip name-server xx.xx.1.xx

ip name-server xx.xx.2.xx

New Member

Re: Obtain DNS automatically from ISP by Cisco router 871

but by your solution, if ISP change the DNS server address, I will have to change my router configuration also.

I would like to have a dynamic configuration so that the router grab DNS information from ISP automatically!!!

Blue

Re: Obtain DNS automatically from ISP by Cisco router 871

Ah, I see what you're saying: You want to use the DHCP-assigned DNS server(s).

Blue

Re: Obtain DNS automatically from ISP by Cisco router 871

Well, according to this blog article, DHCP-supplied DNS parameteers are used automatically (in conjunction with any static "ip name-server" definition), but do not appear in the IOS config. So you may want to enable DHCP debugging and look at how your router sees your ISP's DHCP-supplies DNS parameters, if any.

http://ioshints.blogspot.com/2007/05/dns-resolver-in-cisco-ios-is-auto.html

Blue

Re: Obtain DNS automatically from ISP by Cisco router 871

If you have "dns-server xx.xx.xx.xx" under "ip dhcp pool guest", try removing it and reboot the router.

You can see if DNS parameters are offered with "debug ppp negotiation".

Dialer1/0 IPCP: O CONFREQ [ACKsent] id 3 len 16

Dialer1/0 IPCP: Address 10.0.0.34 (0x03060A000022)

Dialer1/0 IPCP: PrimaryDNS 10.0.0.10 (0x81060A00000A)

Dialer1/0 IPCP: I CONFACK [ACKsent] id 3 len 16

Dialer1/0 IPCP: Address 10.0.0.34 (0x03060A000022)

Dialer1/0 IPCP: PrimaryDNS 10.0.0.10 (0x81060A00000A)

You can see the result with "show host"

#show host

Default domain is not set

Name/address lookup uses domain service

Name servers are 10.0.0.10

Re: Obtain DNS automatically from ISP by Cisco router 871

I previously hard-coded the DNS servers in the local DHCP Scope as I couldn't get this working when I first set this up on a home ADSL router. Anyway my ISP changed their DNS server IP addresses recently so I decided to try and sort it out, so here it is...

ip dhcp pool Local-DHCP-Pool

import all

network 192.168.1.0 255.255.255.0

domain-name somedomain.local

default-router 192.168.1.254

lease 3 0

!

interface Dialer1

ppp ipcp dns request accept

!

It was the 'ppp ipcp dns request accept' line that I needed. Anyway it works for me.

HTH

Andy

Re: Obtain DNS automatically from ISP by Cisco router 871

I just realised you have an 871 and not an ADSL router... If your WAN is using PPPoE then I think the same still applies (i.e. the Dialer Interface). If however the WAN is just a 'normal' Ethernet connection then I assume DHCP is used to lease an IP address?, unfortunately I haven't set anything like this up before.

I did find this on CCO though:

http://www.cisco.com/en/US/docs/routers/access/800/850/software/configuration/guide/857sg_bk.pdf

which might be helpful?

Andy

New Member

Re: Obtain DNS automatically from ISP by Cisco router 871

Hi Andy,

Yes, finally that worked for me also.

Thanks for your post.

1317
Views
0
Helpful
8
Replies
CreatePlease to create content