I am currently implementing openssl into my application. My problem arose when I had to set the hostname, IP - address, and port of the BIO. I have always known ip and hostname to be the same thing. Could someone please explain the difference.
相关问题
- IPAddress.[Try]Parse parses 192.168 to 192.0.0.168
- Port of the Rails app when running Cucumber tests
- Doing ARP and Inverse ARP on Linux 2.6.21 (glibc 2
- Get current domain name from request in Nuxt
- Is there a way to find a port being used by proces
相关文章
- How to resolve hostname to an ip address in node j
- Parsing IP Address to string doesn't work for
- Read image data from COM7 port in Java
- Retrieve IP Address of the Default Printer Driver
- How to solve “Google Play will block publishing of
- getsockname return invalid address
- How do I check whether an open port is TCP or HTTP
- Check if Port is open on Android/Java
A host name can have multiple IP addresses, but not the other way around. If you check out
https://beej.us/guide/bgnet/html/multi/gethostbynameman.html
you'll see that gethostbyname() returns a list of addresses for a particular host. To prove it, here's a small program:
Entering www.yahoo.com, I get the following:
98.137.246.8
98.137.246.7
98.138.219.232
98.138.219.231
A host name is a combination of the name of your machine and a domain name (e.g. machinename.domain.com). The purpose of a host name is readability - it's much easier to remember than an IP address. All hostnames resolve to IP addresses, so in many instances they are talked about like they are interchangeable.