Which of the following hostnames are valid? - http

This is from my lecture slides in the web based systems section of Distributed Systems:
Which of the following hostnames are valid?
122.65.132.11.1.97
My_server
300.320.1.32
The answer is: All three can be valid depending on the scheme used.
I would have thought the answer would be that none are valid; can someone explain why all three could be valid?

First: the ip address is the actual name of the host. Everything else is DNS entry that maps to the ip address.
122.65.132.11.1.97 is a valid IPv6 ip address.
My_server is a valid DNS entry (which presumably could map to a legit host).
Corrected:
300.320.1.32 is a not a valid IPV4 ip address.

Related

What is my IP address in CIDR notation?

I'm trying to following the Quick Start Wordpress for Google App Engine guide; however, the Google Cloud Console appears to have changed slightly with respect to the instructions.
One of the instructions is to select Assign IP Address, and add your IP address to the list of Authorized IP Addressed. The link points to a Google search for "what's my IP address". However, the result does not look like it is in CIDR notation as required:
The IP address doesn't have a slash in it as in the CIDR example. Would it be OK just to enter the "public IP address" as it appears in Google search in the Network field?
Update
I tried entering my public IP address, but it appears with the gray italic text "Not saved" (see below), which does not look promising.
Just add '/32' to your ip... so it should be
82.217.236.160/32
I used whois.geektools.com to look up the IP address you mentioned. If that's
your actual IP address, then the IP range assigned to your ISP is:
inetnum: 82.217.192.0 - 82.217.255.255
netname: ZIGGO-CM
If you convert those IP addresses into binary, then the first 18 bits are
constant for that block of addresses, and the other 14 bits could vary, depending on how your ISP dishes them out to their customers.
So 82.217.192.0/18 (your ISP's block of IP addresses, in CIDR notation) might be a more convenient choice than the 82.217.236.160/32 value, corresponding to the single IP address currently assigned to you at the moment.

Valid host ip address

I am now maintaining a piece of code that has a warning not to use the value 0 or 255 in an IP address for hosts.
Can someone help and shed some light on the restriction, if any, on IP address for host? It is mandatory to backup the info from a trusted source.
I found a few sources around the internet but non are official or trusted enough.
The most reliable info I found until now is located at RFC1123 section 2.5 and here at the IANA IPv4 Address Space Registry.
Back in the days of Class A, B, and C addresses, a class C address that ended in .0 referred to the entire subnet, and .255 was the broadcast address for the subnet. So these addresses couldn't be used for individual hosts.
However, address classes became obsolete decades ago, when Classless Inter-Domain Routing (CIDR) was developed to make more efficient use of IP addresses. This is described in RFC 4632. The general idea is that each network has an explicit subnet mask, which need not exactly match octet boundaries in IP addresses. So the assumption that .0 and .255 are the network and broadcast addresses is no longer valid.
I don't know which software / library you're using, but I vaguely remember reading this a few years ago about IP address schemes of days long past. In any way, today there's no such rule.

Does the idea of private ip address in ipv6?

For the idea of private, I mean it like 10.*.*.* idea of ipv4. It seems ipv6 don't conserve ip addresses like these any more.
So, what if I want to create a private subnet which I don't want the others to know my subnet number or access my subnet with ip address. I can create my own range of ip subnet number, but it seems in that way, it would conflicts with global ip address.
I know the idea of link local address, but I think that's useless when I want several links to constitute a network.
If you are just setting up a private local network for development/testing and don't have any actual IPv6 connectivity of your own (or your ISP is stupid and only gave you a /64) then unique local addresses will work fine for you.
However, unique local addresses cannot be used for connectivity to the global Internet. If you need this, you should get global addresses and a proper firewall (as NAT is not needed and strongly discouraged in IPv6).
To get a /48 ULA prefix, visit this generator and throw in a MAC address. (Using a MAC address to generate the prefix is specified by RFC 4193, which defines unique local addresses.)

How to get the IP address of a remote host from its Ethernet address?

I'm looking for some Linux code to find an IP address from an Ethernet address. I suppose I have to do some inverse ARP trickery but I don't find any example...
http://compnetworking.about.com/od/networkprotocolsip/f/convertipmacadd.htm
Try sending an IP broadcast (e.g. ping 192.168.1.255 if your subnet is 192.168.1.0/24) to prime your ARP cache, followed by arp -a to spit it all out.
For computers that you have communicated with, you can look at their arp entry. This is available in text format in /proc/net/arp for example. Finding an IP address for a MAC that you know but haven't communicated with is significantly more difficult. The closest match, protocol-wise, would be RARP but that's hardly ever in use so your are not likely to get a response.
You can always scan your local subnet to make sure you get a full view in your arp table. See for example fping for an efficient way to do this. Note that hosts don't actually need to respond to the pings in question to appear in the ARP table, so this is useful even in the presence of local firewalls etc.
Take a look at Thomas Habet's Arping. I've not tried it, but the basic idea is to send an ICMP Ping network packet to the MAC address in question using a broadcast destination IP address in the IP header. Only the host with the specified MAC address will reply and the reply will (usually) contain its IP address. It won't always work but it might be good enough for you. See the project readme for limitations.

How to calculate an IPv6 IP Number?

I'm adding GeoIP tracking to WCF Web Service using MaxMinds' GeoIP Lite Country. All works well for their IPv4 database but they don't give any samples to calculate an IPv6 IP Number. I've contacted them and they said to use a search engine.
Anyone have a sample they're willing to share? Any language will do.
Its not a duplicate question per se, but from here:
There is no IPv4 to IPv6 mapping that
is meaningful. things like 0.0.0.0 and
127.0.0.1 are special cases in the spec, so they have equivalent meaning.
But given an IPv4 address it tells you
nothing about what its specific IPv6
address would be. You can use a DNS
lookup to see if a given IP address
resolves to a host which in turn
resolves to an IPv6 address in
addition to an IPv4 address, but the
DNS server would have to be configured
to support that for the specific
machine.

Resources