The prim-dns server script is a modular SecondLife script that will request a temporary URL and register that URL with a [prim-dns web service](https://github.com/annapuddles/prim-dns) instance to automatically create a permanent alias, which client scripts can use to find the current temporary URL of the server at any given time. This allows you to quickly add robust HTTP server functionality to any prim, and the modular design means the core script can be updated without needing to edit your own code, and different functions of a server can be split across multiple scripts for easier management.
You can grab the core prim-dns script along with several examples [here](https://marketplace.secondlife.com/p/prim-dns/24388106).
A working version of the [example file server](file%20server/example) can be viewed [here](https://annapuddles.com/prim-dns/redirect/prim-dns-examples).
The diagram below illustrates the communication between the prim-dns server script, the request handler scripts, the prim-dns web service, and a client.

# Link messages API
Communication between the prim-dns script and the request handler scripts is accomplished via link messages, where the string portion of the message is a JSON-RPC object.
Sent when the prim-dns server finishes reading the configuration and is waiting to continue starting up. If auto_start = 1, then the server will immediately continue, otherwise it will wait for the prim-dns:start messsage.
- The amount of data you can send in a response is limited by the amount of memory available to the core prim-dns script. Therefore, this script needs to be as memory-efficient as possible, but without sacrificing the user interface.
- There could be a second script which actually requests URLs and handles requests and responses, and that script would have more memory to work with. However, it would also be necessary to use multiple prims in order to prevent the core script from receiving link messages that would exceed the memory available to it.