SYSTEM WARNING: 'file_get_contents(https://www.clearos.com/?rendertype=json&get=header): failed to open stream: Connection refused' in '/var/www/virtual/newwrapper/cf_topmenu.inc' line 5

ClearOS Bug Tracker


View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000240ClearOSapp-dns - DNS Serverpublic2011-02-23 08:312019-03-12 08:52
Reportermaeztro 
Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
StatusclosedResolutionsuspended 
PlatformOSOS Version
Product Version5.2-SP1 
Target VersionFixed in Version 
Summary0000240: Local DNS page doesn't display all aliases when /etc/hosts has multiple entries of the same IP address
DescriptionAs 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.
TagsNo tags attached.
Attached Fileszip file icon fix_dns_multiple_ips_v2.zip [^] (635 bytes) 2011-02-23 08:31

- Relationships

-  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 (developer)
2019-03-12 08:52

Migrated to: https://gitlab.com/clearos/clearfoundation/app-dns/issues/1 [^]

- Issue History
Date Modified Username Field Change
2011-02-23 08:31 maeztro New Issue
2011-02-23 08:31 maeztro File Added: fix_dns_multiple_ips_v2.zip
2011-02-23 19:57 user2 Status new => confirmed
2013-02-02 09:51 user2 Note Added: 0000679
2013-02-02 09:51 user2 Severity minor => tweak
2019-03-12 08:52 NickH Note Added: 0010931
2019-03-12 08:52 NickH Status confirmed => closed
2019-03-12 08:52 NickH Resolution open => suspended

SYSTEM WARNING: 'file_get_contents(https://www.clearos.com/?rendertype=json&get=footer): failed to open stream: Connection refused' in '/var/www/virtual/newwrapper/cf_footer.inc' line 7