Skip to content

connection_handler: resolve static server host via DNS - #3

Merged
luar123 merged 1 commit into
luar123:componentfrom
mirko:component-nameresolution
Jul 30, 2026
Merged

connection_handler: resolve static server host via DNS#3
luar123 merged 1 commit into
luar123:componentfrom
mirko:component-nameresolution

Conversation

@mirko

@mirko mirko commented Jul 23, 2026

Copy link
Copy Markdown

The static server (CONFIG_SNAPSERVER_HOST) was only run through ipaddr_aton(), which parses numeric IP literals, so a DNS hostname failed outright. Fall back to netconn_gethostbyname() when it is not a numeric IP, so the configured host may be a hostname resolved on the device network.

Am I assuming correctly this change would - if accepted - go into the upstream branch "component"?

The static server (CONFIG_SNAPSERVER_HOST) was only run through
ipaddr_aton(), which parses numeric IP literals, so a DNS hostname
failed outright. Fall back to netconn_gethostbyname() when it is not a
numeric IP, so the configured host may be a hostname resolved on the
device network.

Build-shim branch based on 1dfe76a (the commit the esphome integration
pins); the upstream-master version of this fix is on nameresolution-addition.

Assisted-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@luar123

luar123 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Thanks! Did you test it?

Am I assuming correctly this change would - if accepted - go into the upstream branch "component"?

You want to have this in the esphome component? Is there any change needed on the esphome side?

@mirko

mirko commented Jul 30, 2026

Copy link
Copy Markdown
Author

Did you test it?

Of course, I'm using it as part of an esphome component on an esp32 - switched the fork/branch this PR is referencing and it works for me.

You want to have this in the esphome component? Is there any change needed on the esphome side?

Can't say much about "outside of esphome", hence this PR targets the esphome component branch.

@luar123
luar123 merged commit b574035 into luar123:component Jul 30, 2026
2 checks passed
@luar123

luar123 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Thanks, updated the esphome snapclient PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants