1

We have a column in a database table that can hold either an IP address or a DNS name, and we're struggling to name it without leaning one way or another.

Is there a "standard" term that means "IP address or DNS name"? Please include a reference to a reliable source.

PMah
  • 139
  • 4
  • By DNS name I assume you mean the fully qualified domain name o the [canonical name](https://en.wikipedia.org/wiki/CNAME_record) of the host, right? Because there are DNS entries that use IP addresses, e.g. A records. – edalorzo Sep 24 '19 at 17:15
  • 1
    I would name it host or host_address – user237329 Sep 24 '19 at 17:44
  • Yeah, "host" or "peer" might be usual, depending on context. – Useless Sep 24 '19 at 17:53
  • Microsoft calls it authority: https://docs.microsoft.com/en-us/dotnet/api/system.uripartial?view=netframework-4.8#fields – Esben Skov Pedersen Sep 24 '19 at 17:59
  • I would have a seperate table that would have four columns. [KEY] [FQDN] [IPv4] [IPv6]. This way when you refernce such data, the software can account for the format without having to do as much validation. You would also want to prefer a method of lookup to make such actions more efficient. The order above would be mine; as some failover connections change the ip you get. The key would be refrenced from the aformentioned table. Depending on the implementation you could use the FQDN or IPv4 as your key to make things even smother on access. Only falling back if its not the prefered format. – Joe Sep 25 '19 at 08:16
  • I understand why this was closed as opinion based (though Christophe gave a good answer with examples), but given that naming things is one of the classic difficult problems in programming, it seems a shame that Stack Exchange cannot seem to help users that actually want to name things better. – Nathanael Sep 30 '19 at 16:15

3 Answers3

6

There is no authoritative standard. In the IETF documentation, you'll find url, urn, uri but none refer to either a resource name or IP address (e.g. the urn may refer to a number such as an ISBN, but it requires a prefix for that).

But if you look at man pages of popular tools like ping or traceroute the usual term used is host which is interpreted either as an ip address or as a symbolic name (which can be DNS name but also a good old local hostname). Note that depending on your OS you'll also find target or destination.

You can find similar use of the general "host" concept to designate the machine behind either an IP address or a name in some popular networking libraries such as poco.

Christophe
  • 74,672
  • 10
  • 115
  • 187
0

Is there a "standard" term that means "IP address or DNS name"?

No, AFAIK there's no standard term describing such.

If you really want to have this in a single DB table column, you should name it for what values could be there actually, e.g. IPAddrOrDNSName.

Though (depending on usage), you might prefer to have two distinct columns like IPAddress and DNSName, since the IP-Address could be used directly with the client code accessing the database, while the DNS name needs some extra processing to determine the underlying IP-Address.

At least another boolean column like IPAddrUsed might be helpful, to indicate what's really stored in that table column.

πάντα ῥεῖ
  • 1,540
  • 3
  • 12
  • 19
-6

Is there a "standard" term that means "IP address or DNS name"?

Site could be used.

πάντα ῥεῖ
  • 1,540
  • 3
  • 12
  • 19
mrflash818
  • 163
  • 6