SommitRealWeird

The usefulness of getent

It appears that if you want to do dns lookups, the output of host is a pain to parse, and dig doesn't follow the systems normal search path. So, the solution is to use getent ahostsv4 <hostname> which has easier to parse output (if you're only looking for v4 addresses).

Apparently this is not a well known thing, so I thought I'd drop it here to tell the world :)

Posted: 2013-09-18 19:37 in Tech | permalink