-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNS lookup error -5 #4949
Comments
Clearly you have multiple dhcpd servers on your network, ie: each AP has dhcpd enabled, and you have them set to give out the connected AP's ip address as the DNS server. If the AP does not have a functioning DNS forwarder enabled, or its network/netmask/gateway settings are incorrect, the AP will not forward DNS request out to the internet to be resolved by a real DNS server. Only one AP or router should have dhcpd enabled (hint: the one that is working). |
@Eszartek I need to clarify that these are separate networks i.e. NETGEAR61 (R6300 Model Router) is setup in an entirely different location from NETGEAR-SP (R7000 Model Router). Here are the internet settings I'm seeing in the R6300 Router: I'll upload a screenshot of the settings for the R7000 router in a bit. Also, for R6300 from my laptop, I'm seeing |
I can't go into detailed troubleshooting of your equipment, but the fact that your routers are giving 192.168.0.x DNS addresses indicates the problem is in the configuration of your router. The ESP device is not the problem. Look for a setting buried in the menus worded something like "Intercept port 53 DNS" and disable it. |
@Eszartek I'm sorry, but I'm not seeing where my routers are returning Just looking through the source, I found where |
It is possible to set 2 dns servers for the STA interface. If no server is specified, the first is set to the gateway (I think), and the second is left unset, i.e.: 0.0.0.0. Several things here:
|
@devyte thanks for the reply. The r7000 was at a different location. I was testing my board on several different networks when I encountered this issue. SUCCESS: so, I changed the network to 192.168.4.1/24 on the r7000 router and was able to reproduce the issue. Then I logged the WiFi mode to Serial and found that STA + softAP was indeed enabled. Adding I kind of feel this should be more readily present in the documentation for the Station Class#begin section. The only place I found mention of this in the online docs was in the Soft Access Point Class#softAP section. Thoughts if I follow up with a Pull Request to add this? |
Go ahead with a PR. |
* Also fixing formatting of unrelated link in station class docs.
Wait, so why does dns lookups fail when in sta+ap mode? simply documenting doesn't really address this. |
The ESP want to do a dns lookup. To do that, it sends a query to the DNS server, which is 192.168.4.1. In contrast, when the dns server was in different network 192.168.5.1, lwip immediately realized that the address wasn't local, so it sends it out the sta interface, despite being in sta+ap mode. This is pretty standard, and is the way even laptops and cellphones work. It's not specific to the ESP. |
oh ok, that does make sense, I guess I was thinking that dns lookups would not do loopbacks for some reason. |
Basic Infos
Platform
Settings in IDE
Problem Description
DNS doesn't consistently resolve when the ESP is connected to my NETGEAR R6300 router. I have no idea why. I've tried wiping flash a few times, all to no avail. I feel like DNS used to resolve hostnames on this network just fine, but now it's not.
I have 3 different Access Points that I test my sketch with:
DNS works on all but the first.
Successful Sketch Run
Un-successful Sketch Run
MCVE Sketch
Debug Messages
The text was updated successfully, but these errors were encountered: