Added changes to accept discovery/api server IP or dns name

This patch add appropriate changes to support either IP address or dns name for
 discovery or api server.
It copied dns_resolve function from puppet-rjil to avoid dependancy on it.
Merge pull request #26 from hkumarmk/discovery_name_or_ip

Added changes to accept discovery/api server IP or dns name