[TriLUG] Syntax checker for /etc/hosts ?

Jeremy Portzer jeremyp at pobox.com
Wed Oct 30 08:26:16 EDT 2013


Thanks for the replies everyone.  We are eventually moving to Chef which 
will manage hosts files efficiently, but it's going to be years (??) 
before it's fully rolled out.

I do like John Vaughters' suggestion about a simple database elsewhere 
for maitaining the file - primarily because we already have a database 
and front-end for other configuration items that we may be able to 
extend for this use.  Though at some point if too complext this just 
begins to duplicate the use of Chef...

Cheers,
Jeremy

On 26/10/2013 8:33 AM, Scott Lambdin wrote:
> The visiting Puppet trainer mentioned a spiffy utility for editing config
> files.   http://augeas.net/
>
> Might not be worth the effort in this case.
>
> --Scott
>
>
> On Fri, Oct 25, 2013 at 1:28 PM, Kevin Hunter Kesling
> <hunteke at earlham.edu>wrote:
>
>> On 10/24/2013 04:58 PM, Jeremy Portzer wrote:
>>
>>> Is there any standard command to check the syntax and "sanity" in
>>> /etc/hosts?
>>>
>>
>>   While I could write a short script easily enough to do this, I
>>> thought it might be a common problem and there may be some other
>>> standard way to check it.
>>>
>>
>> Not of which I'm aware, but a sysadmin colleague from a former job used a
>> script he created for the purpose of helping out those less skilled in the
>> ways of Vi.  I think this is an old draft, but it gets the job done.
>>
>> This list doesn't do attachments, so I've pasted it to pastebin:
>>
>>      http://pastebin.com/qyrq7RUT
>>
>> He was (is?) a bit of a whitespace nazi, but he was also a damn good
>> sysadmin.
>>
>> It's GPL, so edit it for your needs, if you like.
>>
>> Cheers,
>>
>> Kevin
>>
>> --
>> This message was sent to: Scott Lambdin <lopaki at gmail.com>
>> To unsubscribe, send a blank message to trilug-leave at trilug.org from that
>> address.
>> TriLUG mailing list : http://www.trilug.org/mailman/**listinfo/trilug<http://www.trilug.org/mailman/listinfo/trilug>
>> Unsubscribe or edit options on the web  : http://www.trilug.org/mailman/**
>> options/trilug/lopaki%40gmail.**com<http://www.trilug.org/mailman/options/trilug/lopaki%40gmail.com>
>> Welcome to TriLUG: http://trilug.org/welcome
>>



More information about the TriLUG mailing list