2

Simple question: I have following switch configuration:

interface Vlan1
 ip address dhcp
end

ip domain-lookup 

I receive and IP and DNS servers along with it from our DHCP server. At least Windows clients in the same network, do. So i want to use DNS lookups, but the switch does not use the dns servers. What am i missing?

Switch#ping swinf03
*Feb 10 16:48:57.041: %SYS-5-CONFIG_I: Configured from console by console02
% Unrecognized host or address, or protocol not running.

Using the FQDN (even though, DNS suffix should be provided within the DHCP options) i cant get a response:

Switch#ping swinf03.company.local
% Unrecognized host or address, or protocol not running.

If i check what DNS servers are configured, i get following:

Switch#show ip dns servers 

   IP            VRF      TTL(s)   RTT(ms)  RTO(ms)  EDNS  DNSSEC  RECURSION
-----------------------------------------------------------------------------
255.255.255.255           817      1000     4000      Yes    Yes     Yes   

Platform is a IOS-XE Cisco 9200 switch.

  • 1
    Really, you do not want to configure your network infrastructure devices with DHCP. – Ron Maupin Feb 10 at 22:42
3

There are some options the client can request when IOS XE (and vanilla IOS, too) is a DHCP client.

I dont' have a Catalyst 9k at hand to test, but some of it might be in there, too

This is from a CSR 1000v (IOS XE at a prehistoric 03.13.06.S, resp. 15.4(3)S6 )

CSR1Kv-RTR1(config-if)#ip dhcp client request ?
  classless-static-route  Classless static route (121)
  dns-nameserver          DNS nameserver (6)
  domain-name             Domain name (15)
  netbios-nameserver      NETBIOS nameserver (44)
  router                  Default router option (3)
  static-route            Static route option (33)
  tftp-server-address     TFTP server address (150)
  vendor-specific         Vendor specific option (43)
  <cr>

You might want to check if your Catalyst supports any of these as well.

After setting this (some of which seems to be default, i.e. will disappear from the config)

interface GigabitEthernet3
 description *** mgmt interface ***
 ip address dhcp
 ip dhcp client request domain-name
 ip dhcp client request dns-nameserver
 ip dhcp client request router
 negotiation auto

... IOS-XE on the CSR came up with this:

CSR1Kv-RTR1#show dhcp lease
Temp IP addr: 172.19.41.0  for peer on Interface: GigabitEthernet3
Temp  sub net mask: 255.255.254.0
   DHCP Lease server: 172.19.40.1, state: 5 Bound
   DHCP transaction id: 1BE
   Lease: 691200 secs,  Renewal: 345600 secs,  Rebind: 604800 secs
Temp default-gateway addr: 172.19.40.1
   Next timer fires after: 3d23h
   Retry count: 0   Client-ID: cisco-5254.004b.a9ec-Gi3
   Client-ID hex dump: 636973636F2D353235342E303034622E
                       613965632D476933
   Hostname: CSR1Kv-RTR1

... and this:

CSR1Kv-RTR1#show dhcp server
   DHCP server: ANY (255.255.255.255)
    Leases:   2
    Offers:   2      Requests: 2     Acks : 2     Naks: 0
    Declines: 0      Releases: 3     Query: 0     Bad: 0
    VRF: global
    DNS0:   172.19.41.25,   DNS1:  172.19.41.26
    Subnet: 255.255.254.0   DNS Domain: dyn.netztier.li

Oh.. and if you're actually using .local as your internal toplevel domain, please reconsider: What special reserved domain could I use for virtual organization private network?

| improve this answer | |
  • Thanks for your detailed response. It helped me getting to the source of this. It turns out, it just works out of the box. I was using the management port on the device, that does not do this. If i connect a normal port and configure a vlan interface as dhcp client, eveything works as expected. Even DNS suffix works now. I can see my DNS servers in show dhcp server and in the show ip dns servers command now. – Mario Jost Feb 11 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.