Erlang: get ip address from hostname - networking

In my local network exists pcs, where have a hostname as example "testhost". How can I from given hostname get a IP-address ?
I tried:
net_adm:dns_hostname("testhost.fritz.box").
Result:
{ok,"testhost.fritz.box"}
I need a function which give me IP-Address from hostname.
Thx

According to http://erlang.org/doc/man/inet.html#getaddr-2 it seems you should be able to use getaddr like:
inet:getaddr("testhost.fritz.box", inet)

Related

Numeric IP address of a website

I am trying to get the IP address which loads a certain website. For example; www.smmadmin.com - I tried http://192.185.77.222/ but that shows 404 page, the IP address is given by getip.com
How does this thing work? and how to get the actual IP address?
You can simply try ping command if you are on Windows.
ping www.smmadmin.com
Let me know if it doesn't work

Common term for hostname and IP address?

A simple question. Is there a generic term for hostname and IP address? I would like to call them in with one name in a UI field.
You can use term like Server Address or Destination Server, if that helps.

Getting Device Hostname

I have a unix machine on a network and I'm looking to get the device hostname for devices on that network. How do I go about doing this? I've tried nmap, arpscan, host, and nslookup but they all seem to want to do a DNS reverse lookup. I don't have a DNS server on the network.
When I say hostname I'm referring to the device name set by the user. So for example host on my machine returns joshcloud.
I'll give you the same answer I gave here: How to get hostname from IP(Linux)?. Basically you're going to need to either add DNS entries or connect to each host individually and ask for names.
nbtscan for Windows devices. avahi for things that suppor zeroconf.
Otherwise check out the other answer.

How to get the domain name from an ipaddress

I want to resolve a IP address to a domain name but I don't get the desired result.
I want to retrieve the real web name something like this "google.com" from the ip address "74.125.225.100" but what I get is "ord08s08-in-f4.1e100.net"
I tried using whois and the traceroute commands in linux.
There is no unique relation beetween an ip and a domain name.
What you get with traceroute is a computer name.
But one computer may host dozens of domains.
you can use nslookup command in linux.
using nslookup <ip address> you can resolve the domain name of the IP address.
this is the link to a similar post.
http://whois.net/domain-name-ip-address/ This is exactly what you are searching for.

Looking for a list of aliases

All,
I have an IP address and I want to know all aliases within my organization that point to this IP. Is it possible?
For example I know the alias "TESTBOX" points to 119.119.119.119.
How can by just knowing the IP come up with the "TESTBOX" ?
Thanks,
M
Short answer: You can't.
You can try a reverse lookup on the IP address, but that will only show you the address that has been specifically allocated in the reverse DNS to that IP address.
Remember, aliases might exist only as an entry on a single machine's hosts file. They might also exist in a DNS server on the other side of the planet. However, if you're only interested in local DNS aliases, and your DNS servers allow zone transfers, then you can try listing every entry in every domain (eg. with host -l xyzzy.bigcorp.com) and searching the results for the IP address in question.

Resources