cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7291
Views
5
Helpful
5
Replies

How to automatically add the DNS servers from my ISP into the DHCP pool

iliankostadinov
Level 1
Level 1

Hello,

I have cisco router C1700. Interface FastEthernet0 is connected to ISP and obtain public IP and DNS via dhcp.

On interface FastEthernet1 is connected private network. On router is configured dhcp pool that assigns addresses

to private network connected on FastEthernet1. Is there configuration that automatically add the DNS servers from my ISP into the DHCP pool?

1 Accepted Solution

Accepted Solutions

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

In your DHCP pool configuration, use the command import all - for example:

ip dhcp pool LAN

network 192.168.1.0 /24

default-router 192.168.1.1

import all

The "import all" will cause that the router will request a number of DHCP-configurable options from the DHCP server and it will import them into the pool. As you can see in this example, there is no DNS server configured, yet the router will request the DNS server setting from the DHCP server and feed it into this pool. There will be no visible command in the configuration but the stations shall be able to receive address of the DNS server.

You will need to shutdown and reactivate the interface configured with "ip address dhcp" after adding the "import all" to your DHCP pool configurations in order to make the router request additional options from the DHCP and feed them into the pools.

Best regards,

Peter

View solution in original post

5 Replies 5

DialerString_2
Level 3
Level 3

You can add those entries in your DHCP configuration and they will be handed to the workstations.

ip dhcp pool "dynamic(Pool Name)"
    dns-server 'isp dns 1" "isp dns 2"

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

In your DHCP pool configuration, use the command import all - for example:

ip dhcp pool LAN

network 192.168.1.0 /24

default-router 192.168.1.1

import all

The "import all" will cause that the router will request a number of DHCP-configurable options from the DHCP server and it will import them into the pool. As you can see in this example, there is no DNS server configured, yet the router will request the DNS server setting from the DHCP server and feed it into this pool. There will be no visible command in the configuration but the stations shall be able to receive address of the DNS server.

You will need to shutdown and reactivate the interface configured with "ip address dhcp" after adding the "import all" to your DHCP pool configurations in order to make the router request additional options from the DHCP and feed them into the pools.

Best regards,

Peter

Thank you Peter,

this is solution that I search for.

Best Regards,

Ilian Kostadinov

ip dhcp pool LAN-Address

   import all

   network 192.168.1.0 255.255.255.0

   domain-name home.owa

   default-router 192.168.1.1

   dns-server xx.xx.xx.xxx xx.xx.xx.xxx

My looks like this but when I take off the dns-server line eventho i have import all my router wont translate dns, so I have to keep both link the import all and the dns-server line inorder for me to surf website, any reason that I am doing something wrong. 

Hello,

If you remove the dns-server from your DHCP pool configuration and leave only the import all command in place, what DNS server will be assigned to your PC in the inside network by the DHCP running on your router? Is it the same DNS server as the one you have specified using the dns-server line?

If the PC is not assigned a DNS server then try shutting down and again reactivating your outside interface on the router to force it to reacquire its own IP address and other options via DHCP, and then try to release and renew the IP address on your PC. If still no DNS server is assigned then it is possible that this particular option is not supplied in DHCP by your ISP.

Note that neither of these two commands are instructing your router to perform DNS lookups on behalf of your PC. You should not expect your router to essentially behave as a resolving DNS server.

Best regards,

Peter

Review Cisco Networking for a $25 gift card