• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 WEBSERVER togeter with SQL connection (error"[ 2774][E][WiFiGeneric.cpp:1360] hostByName(): DNS Failed for xxxx.com)

Q&A Forum › Category: ESP32 › ESP32 WEBSERVER togeter with SQL connection (error"[ 2774][E][WiFiGeneric.cpp:1360] hostByName(): DNS Failed for xxxx.com)
0 Vote Up Vote Down
João Rodrigues asked 3 years ago

Hello
First of all thanks to Rui & Sara for this great project
My goal is to build an Webserver and connect to external SQl database to query some data.
Basically I´m using “wi-fi manager for webserver” project 
My problem i´m getting error”[ 2774][E][WiFiGeneric.cpp:1360] hostByName(): DNS Failed for xxxx.com
[HTTP] GET… failed, error: connection refused
If i run the standalone code bellow it´s connect to sql database without any problem
 
HTTPClient http;
http.begin(queryString); //HTTP
int httpCode = http.GET();
// httpCode will be negative on error
if(httpCode > 0) {
// file found at server
if(httpCode == HTTP_CODE_OK) {
String payload = http.getString();
Serial.println(payload);
} else {
// HTTP header has been send and Server response header has been handled
Serial.printf(“[HTTP] GET… code: %d\n”, httpCode);
}
} else {
Serial.printf(“[HTTP] GET… failed, error: %s\n”, http.errorToString(httpCode).c_str());
}
http.end();
 
when i put the same code inside my project i got error
[ 2774][E][WiFiGeneric.cpp:1360] hostByName(): DNS Failed for xxxx.com)
 
I think it´s some imcompatibility with other libraries.
Does anybody have any experience with this error?
Best regards
 
João Rodrigues
 
 
 
 

1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
I’m not familiar with that issue.
However, I found this discussion that seems similar to yours.
https://stackoverflow.com/questions/68508224/getting-ewifigeneric-cpp739-hostbyname-dns-failed-when-performing-post-r
They provide some solutions. See if it applies to your case scenario.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.