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

Attention: The Community will be in read-only mode on 12/14/2017 from 12:00 am pacific to 11:30 am.

During this time you will only be able to see content. Other interactions such as posting, replying to questions, or marking content as helpful will be disabled for few hours.

We apologize for the inconvenience while we perform important updates to the Community.

New Member

DNS and Default-router

A cisco switch(layer 3 and layer 2)can be configure so it contains dns-server and default gateway. What's the purpose for that. If i don't do this , might cause any problems.



Cisco Employee

Re: DNS and Default-router

Hi Moses,

Default gateway is basically used on layer 2 switches or layer 3 switches working as a layer 2 switch.

Layer 2 switch has only one layer 3 interface for management purpose and when you try to manage your switch from some remote subnet then switch should know where to send the reply back and that is the job of default gateway on l2 switches.

If it is a layer 3 switch it will have default route.



*Pls rate all helpfull post

New Member

Re: DNS and Default-router

Ankur thanks a lot

What's the role of the DNS. Today for examble i put a pc on the net. I tried to ping a spesific name and i couldn't. The dhcp server (router)gave the right dns server to resolve the the name , but the pc couldn't. Meantime the pc was connected directly to a layer 3 switch which was not configured with the right dns server. After i put the rigth dns server at the swithc then the pc could resolve the name.

Why this is happenning?

Thanks a lot


Hall of Fame Super Blue

Re: DNS and Default-router

Hi Moses

DNS as you probably know is used to resolve names to IP addresses and IP addresses to names.

The dns-server option under the DHCP config on the router tells the PC which server to query when it needs to resolve something with DNS.

I'm not sure i entirely follow what your problem was. What dns-server entry were you handing out to PC and did that server have a record for the name you were pinging ?


New Member

Re: DNS and Default-router

Hi jon and thanks

The network is like this.The router connected to a layer 3 switch and a PC connected to the layer 3 switch. The dns server has the ip say as an examble for Full name). The DHCP server of the router has the following configuration.

Ip dhcp pool net1


default-gateway (which is the interface of the router).

dns server

So when the pc gets the ip from the router and write at cmd of the pc ipconfig/all we can see the dns server .

At the layer 3 switch i did not put the as a dns server.

When i ping from the pc i can see it. When i ping with its name( i can not.

Then i put the as a dns server on the layer 3 switch. Then from my pc i could ping with the name(

Why is that happening?

What's the purpose of putting a dns-server on a layer 3 switch?



Re: DNS and Default-router

The PC only reads the address of the DNS server when it does its DHCP request. If the router gives it a false DNS server address, the PC is stuck with it until next time it re-boots. Correcting the DNS server address in the router will not have any effect until next time the PC re-starts and gets its DHCP settings from the router.

Kevin Dorrell


CreatePlease to create content