Skip to content

Instantly share code, notes, and snippets.

@rickychilcott
Created August 21, 2012 10:59
Show Gist options
  • Save rickychilcott/3414537 to your computer and use it in GitHub Desktop.
Save rickychilcott/3414537 to your computer and use it in GitHub Desktop.
MunkiServer Debug
def get_hostname(ip)
hostname = Socket.gethostbyaddr(ip.split(".").map(&:to_i).pack("CCCC")).first # Get hostname
logger.warn "Request IP: #{ip}" # Print IP input
logger.warn "Request Hostname: #{hostname}" # Print hostname output
"localhost"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment