python: check if a hostname is resolved

Viewed 42196

How can I have a function in python that returns 1 if the a hostname resolves and 0 if a hostname does not.

I couldn't find anything useful, any thoughts?

Thanks,

1 Answers
Related