After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 761302 - hostname-as-IP-address becomes weird search domain in DNS
hostname-as-IP-address becomes weird search domain in DNS
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: IP and DNS config
unspecified
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-01-29 17:15 UTC by Dan Williams
Modified: 2016-02-01 09:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dns: don't add and IPv4 addresss like hostname to the search domains (925 bytes, patch)
2016-01-29 18:24 UTC, Thomas Haller
none Details | Review

Description Dan Williams 2016-01-29 17:15:50 UTC
# Generated by NetworkManager
search openstacklocal 1.0.3
nameserver 10.1.4.30

"1.0.3" is a pretty odd search domain, and that's apparently because the system hostname is actually "192.1.0.3" as reported by "sysctl -a".

If the hostname looks like an IP address, we probably shouldn't do the search domain magic in src/dns-manager/nm-dns-manager.c::update_dns().
Comment 1 Thomas Haller 2016-01-29 18:24:38 UTC
Created attachment 320031 [details] [review]
dns: don't add and IPv4 addresss like hostname to the search domains
Comment 2 Dan Williams 2016-01-29 22:15:09 UTC
LGTM
Comment 3 Thomas Haller 2016-02-01 09:33:11 UTC
merged: http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=da4ae74fff1e931b257d3dc1473cb06de690af72


note I changed to AF_INET to AF_UNSPEC, to also reject hostnames that look like an ipv6 address.