Skip to content
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

Readme: fill DNS server if setSTAStaticIPConfig #1053

Merged
merged 1 commit into from May 14, 2020

Conversation

dontsovcmc
Copy link
Contributor

I think it's better to add Note about DNS if somebody want to use static IP and syncronize time (NTP) or request web servers by hostname in source code.

@tablatronix tablatronix added the Documentation Flagged for docs label May 14, 2020
@tablatronix tablatronix merged commit 062e66b into tzapu:development May 14, 2020
@tablatronix
Copy link
Collaborator

Could also add a debug if dns is empty, saying no dns, hostnames will not resolve or something.

Is it possible to get the dns server or assume it is gateway if unset?

@dontsovcmc
Copy link
Contributor Author

"Is it possible to get the dns server or assume it is gateway if unset?"
https://www.quora.com/How-does-the-computer-know-which-DNS-server-to-use#
The main idea: routers has DNS-relay function, that proxies DNS requests to ISP DNS servers, obtained by router.
I think Debug message if DNS is empty needed. "Hidden magic" DNS=gateway isn't good practise.

@tablatronix
Copy link
Collaborator

true but typically your dns server is going to be the same one if you were dhcp.. so can we query that server and cache it etc. Does dhcp provision dns servers?

@dontsovcmc
Copy link
Contributor Author

It's bad idea to make hidden requests to dhcp server. One of the reason of using static ip when you don't have dhcp server.

@dontsovcmc
Copy link
Contributor Author

Here is the same problem: esp8266/Arduino#2371 (comment)

@chupocro
Copy link

"Is it possible to get the dns server or assume it is gateway if unset?"
https://www.quora.com/How-does-the-computer-know-which-DNS-server-to-use#
The main idea: routers has DNS-relay function, that proxies DNS requests to ISP DNS servers, obtained by router.
I think Debug message if DNS is empty needed. "Hidden magic" DNS=gateway isn't good practise.

A few years ago static IP worked without specifying DNS - probably the same IP as gateway was used as DNS IP if DNS wasn't specified in wifi.config()

I have some older code from 2016. and 2017. I had to rewrite for compiling it with present libraries because the devices couldn't connect to the server with the old code until I added DNS. Someone will probably confirm the IP used for DNS was the same as gateway in the old libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Flagged for docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants