[Bug 1217355] New: Syntax of localhost entry is wrong in /etc/hosts
https://bugzilla.suse.com/show_bug.cgi?id=1217355 Bug ID: 1217355 Summary: Syntax of localhost entry is wrong in /etc/hosts Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: screening-team-bugs@suse.de Reporter: kukuk@suse.com QA Contact: qa-bugs@suse.de Target Milestone: --- Found By: --- Blocker: --- Our /etc/hosts has: 127.0.0.1 localhost # fallback hostname used by NetworkManager 127.0.0.1 localhost.localdomain According to the documentation (man hosts), only one line per IP address is allowed. As result, the localhost.localdomain entry is not used: # getent hosts 127.0.0.1 127.0.0.1 localhost All hostnames for one IP must be in the same line. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1217355 https://bugzilla.suse.com/show_bug.cgi?id=1217355#c4 --- Comment #4 from Thorsten Kukuk <kukuk@suse.com> --- (In reply to André Werlang from comment #3)
$ getent hosts 127.0.0.1 localhost 127.0.0.1 localhost.localdomain
What do you want to tell us with this? That listening the file line by line works? This does say nothing about if the syntax is correct or if the name is resolveable. And as I did show, 127.0.0.1 is not correct solveable. And if you look at the glibc source code, you will see that for resolving a host, the code does not go through every line, but stops at the first matching line. So your second line is not reached. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1217355 https://bugzilla.suse.com/show_bug.cgi?id=1217355#c5 Danilo Spinella <danilo.spinella@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #5 from Danilo Spinella <danilo.spinella@suse.com> --- The fix has been pushed to Factory, closing as fixed. Thank you for spotting this bug. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com