ClearFoundation Tracker - ClearOS
View Issue Details
0000240ClearOSapp-dns - DNS Serverpublic2011-02-23 08:312019-03-12 08:52
maeztro 
 
normaltweakalways
closedsuspended 
5.2-SP1 
 
0000240: Local DNS page doesn't display all aliases when /etc/hosts has multiple entries of the same IP address
As described in the following forum post:

http://www.clearfoundation.com/component/option,com_kunena/Itemid,232/catid,39/func,view/id,24687/ [^]

If the /etc/hosts file has multiple entries of the same IP address, each one with different aliases, the local DNS page will only show the last entry of that IP address, hiding from the user some other aliases that address could have.

This only happens if the /etc/hosts file is modified by hand and manually add the "duplicated" IP entries. Like in my case, I found the problem when I copied over the hosts file of one of my servers which has one IP address per alias, it was written that way for readability. I know that the hosts file man page says that there should be only one entry per IP address but in practice it allows multiple lines.

I'm attaching a little patch that fixes this behavior on the local DNS page, displaying only one IP address and all its aliases no matter how much times that address is listed in the hosts file, and when updating the host in the local DNS page, it saves only one lline per IP address with all its associated aliases.
No tags attached.
zip fix_dns_multiple_ips_v2.zip (635) 2011-02-23 08:31
https://tracker.clearos.com/file_download.php?file_id=12&type=bug
Issue History
2011-02-23 08:31maeztroNew Issue
2011-02-23 08:31maeztroFile Added: fix_dns_multiple_ips_v2.zip
2011-02-23 19:57user2Statusnew => confirmed
2013-02-02 09:51user2Note Added: 0000679
2013-02-02 09:51user2Severityminor => tweak
2019-03-12 08:52NickHNote Added: 0010931
2019-03-12 08:52NickHStatusconfirmed => closed
2019-03-12 08:52NickHResolutionopen => suspended

Notes
(0000679)
user2   
2013-02-02 09:51   
Alternative: the system should just throw an exception when an invalid hosts file is detected.
(0010931)
NickH   
2019-03-12 08:52   
Migrated to: https://gitlab.com/clearos/clearfoundation/app-dns/issues/1 [^]