This is the 15th day of my participation in the genwen Challenge

Domain Name System (Domain Name System)

DNS is a service of the Internet.

As a distributed database that maps domain names and IP addresses to each other, it makes it easier for people to access the Internet.

DNS uses TCP and UDP port 53.

Currently, each level of a domain name is limited to 63 characters, and the total length of a domain name cannot exceed 253 characters.

#include<ESP8266WiFi.h> #include<ESP8266WebServer.h> #include<ESP8266mDNS.h> const char *ssid="STM32L476"; const char *password="284122348"; ESP8266WebServer webServer(80); const char mainPageString[]PROGMEM="<! DOCTYPE html>\r\n\ <html lang='en'>\r\n\ <head>\r\n\ <meta charset='UTF-8'>\r\n\ <title>Hello World</title>\r\n\ </head>\r\n\ <body>\r\n\ <H1>Hello ESP8266</H1>\r\n\ form mDNS example.\r\n\ </body>\r\n\ </html>"; void initWifi() { WiFi.disconnect(); WiFi.mode(WIFI_STA); WiFi.begin(ssid,password); Serial.println(""); while(WiFi.status()! =WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.print("Connect to "); Serial.println(ssid); Serial.print("IP Address: "); Serial.println(WiFi.localIP()); } void handleRoot(){ webServer.send(200,"text/html",mainPageString); webServer.client().stop(); } void handleNotFound(){ webServer.send(404,"text/html","404 File Not Found!" ); webServer.client().stop(); } void setup(){ Serial.begin(115200); initWifi(); if(! MDNS.begin("esp8266")){ Serial.println("Error setting up MDNS responder!" ); while(1){ delay(1000); } } Serial.println("mDNS responder started"); MDNS.addService("http","tcp",80); webServer.on("/",HTTP_GET,handleRoot); webServer.onNotFound(handleNotFound); webServer.begin(); } void loop(){ webServer.handleClient(); }Copy the code

= = =

= = =

The results of

Welcome to pay attention to my public number, like a little bit in see it.

This article uses the article synchronization assistant to synchronize