You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* optionally configured services, for example NetBIOS/LLMNR/WINS
147
178
179
+
If multiple addresses available, it uses a [prefix policy table](https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-ipv6-in-windows)
180
+
and dynamically adjusts preference based on interface reachability and past success.
@@ -1160,21 +1196,51 @@ The server then decides whether to gzip the returned payload, which is uncompres
1160
1196
Where `x` is an IP address as an int atom, returns its hostname as a symbol atom.
1161
1197
1162
1198
```q
1163
-
q).Q.host .Q.addr`localhost
1199
+
q).Q.host 2130706433i
1164
1200
`localhost
1165
-
q).Q.addr`localhost
1166
-
2130706433i
1201
+
```
1167
1202
1203
+
The operator [`$`](tok.md#ip-address) (tok) can be used to convert an IP address in dotted-decimal string representation to an integer
1204
+
```q
1168
1205
q)"I"$"104.130.139.23"
1169
1206
1753385751i
1170
1207
q).Q.host "I"$"104.130.139.23"
1171
1208
`netbox.com
1172
-
q).Q.addr `netbox.com
1173
-
1753385751i
1209
+
```
1210
+
1211
+
Each underlying operating system deals with resolving a hostname to IP (and vice-versa) in different ways, reference [`.Q.addr`](#addr-iphost-as-int) for details.
1212
+
1213
+
When the resolving leads to consulting a DNS server, the DNS server can also have rules on which IP (or the sort order of IPs) it can return when multiple IPs associated with one host.
1214
+
Therefore performing an IP lookup from a given hostname, then using the resuling IP to get its hostname, can return a different hostname.
1215
+
For example:
1216
+
1217
+
```q
1218
+
q).Q.host .Q.addr `$"www.yahoo.co.uk"
1219
+
`a7de0457831fd11f7.awsglobalaccelerator.com / alternative hostname for IP
1220
+
```
1221
+
1222
+
When using `/etc/hosts` on MacOS/Linux, the order in which multiple hosts are associated with an IP will effect the value returned.
1223
+
For example, `/etc/hosts` with the entry
1224
+
```bash
1225
+
172.17.0.4 test1 test2
1226
+
```
1227
+
will cause 172.17.0.4 to be resolved to test1
1228
+
```q
1229
+
q).Q.host "I"$"172.17.0.4"
1230
+
`test1
1231
+
```
1232
+
but `/etc/hosts` with the machine names in a different order
1233
+
```bash
1234
+
172.17.0.4 test2 test1
1235
+
```
1236
+
will cause 172.17.0.4 to be resolved to test2
1237
+
```q
1238
+
q).Q.host "I"$"172.17.0.4"
1239
+
`test2
1174
1240
```
1175
1241
1176
1242
:fontawesome-regular-hand-point-right:
1177
-
[`.Q.addr`](#addr-iphost-as-int) (IP/host as int), [`$`](tok.md#ip-address)tok (IP address as int)
1243
+
[`.Q.addr`](#addr-iphost-as-int) (IP/host as int), [`.z.h`](dotz.md#zh-host) (host), [`.z.a`](dotz.md#za-ip-address) (IP address)
0 commit comments