Have you power-cycled the router? Is it only one network that it won't connect to?
When you go into the WiFi settings and tap the gear icon (based on my Nexus 6P running Nougat so yours may be different) you should see a MAC address. If you don't, you may have a problem with the WiFi in the device.