github.com/StackExchange/dnscontrol/v4@v4.11.0/documentation/language-reference/domain-modifiers/LOC.md (about) 1 --- 2 name: LOC 3 parameters: 4 - deg1 5 - min1 6 - sec1 7 - deg2 8 - min2 9 - sec2 10 - altitude 11 - size 12 - horizontal_precision 13 - vertical_precision 14 parameter_types: 15 name: string 16 target: string 17 deg1: number 18 min1: number 19 sec1: number 20 deg2: number 21 min2: number 22 sec2: number 23 altitude: number 24 size: number 25 horizontal_precision: number 26 vertical_precision: number 27 --- 28 29 The parameter number types are as follows: 30 31 ``` 32 name: string 33 target: string 34 deg1: uint32 35 min1: uint32 36 sec1: float32 37 deg2: uint32 38 min2: uint32 39 sec2: float32 40 altitude: uint32 41 size: float32 42 horizontal_precision: float32 43 vertical_precision: float32 44 ``` 45 46 47 ## Description ## 48 49 Strictly follows [RFC 1876](https://datatracker.ietf.org/doc/html/rfc1876). 50 51 A LOC record holds a geographical position. In the zone file, it may look like: 52 53 ```text 54 ; 55 pipex.net. LOC 52 14 05 N 00 08 50 E 10m 56 ``` 57 58 On the wire, it is in a binary format. 59 60 A use case for LOC is suggested in the RFC: 61 62 > Some uses for the LOC RR have already been suggested, including the 63 USENET backbone flow maps, a "visual traceroute" application showing 64 the geographical path of an IP packet, and network management 65 applications that could use LOC RRs to generate a map of hosts and 66 routers being managed. 67 68 There is the UK based [https://find.me.uk](https://find.me.uk/) whereby you can do: 69 70 ```sh 71 dig loc <uk-postcode>.find.me.uk 72 ``` 73 74 75 There are some behaviours that you should be aware of, however: 76 77 > If omitted, minutes and seconds default to zero, size defaults to 1m, 78 horizontal precision defaults to 10000m, and vertical precision 79 defaults to 10m. These defaults are chosen to represent typical 80 ZIP/postal code area sizes, since it is often easy to find 81 approximate geographical location by ZIP/postal code. 82 83 84 Alas, the world does not revolve around US ZIP codes, but here we are. Internally, 85 the LOC record type will supply defaults where values were absent on DNS import. 86 One must supply the `LOC()` js helper all parameters. If that seems like too 87 much work, see also helper functions: 88 89 * [`LOC_BUILDER_DD({})`](LOC_BUILDER_DD.md) - build a `LOC` by supplying only **d**ecimal **d**egrees. 90 * [`LOC_BUILDER_DMS_STR({})`](LOC_BUILDER_DMS_STR.md) - accepts DMS 33°51′31″S 151°12′51″E 91 * [`LOC_BUILDER_DMM_STR({})`](LOC_BUILDER_DMM_STR.md) - accepts DMM 25.24°S 153.15°E 92 * [`LOC_BUILDER_STR({})`](LOC_BUILDER_STR.md) - tries the coordinate string in all `LOC_BUILDER_DM*_STR()` functions until one works 93 94 ## Format ## 95 96 The coordinate format for `LOC()` is: 97 98 `degrees,minutes,seconds,[NnSs],deg,min,sec,[EeWw],altitude,size,horizontal_precision,vertical_precision` 99 100 101 ## Examples ## 102 103 {% code title="dnsconfig.js" %} 104 ```javascript 105 D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER), 106 // LOC "subdomain", d1, m1, s1, "[NnSs]", d2, m2, s2, "[EeWw]", alt, siz, hp, vp) 107 //42 21 54 N 71 06 18 W -24m 30m 108 LOC("@", 42, 21, 54, "N", 71, 6, 18, "W", -24, 30, 0, 0), 109 //42 21 43.952 N 71 5 6.344 W -24m 1m 200m 10m 110 LOC("a", 42, 21, 43.952, "N", 71, 5, 6.344, "W", -24, 1, 200, 10), 111 //52 14 05 N 00 08 50 E 10m 112 LOC("b", 52, 14, 5, "N", 0, 8, 50, "E", 10, 0, 0, 0), 113 //32 7 19 S 116 2 25 E 10m 114 LOC("c", 32, 7, 19, "S",116, 2, 25, "E", 10, 0, 0, 0), 115 //42 21 28.764 N 71 00 51.617 W -44m 2000m 116 LOC("d", 42, 21, 28.764, "N", 71, 0, 51.617, "W", -44, 2000, 0, 0), 117 END); 118 ``` 119 {% endcode %}