Jump to content




Host - Local DNS Hosting API


1 reply to this topic

#1 Dave-ee Jones

  • Members
  • 456 posts
  • LocationVan Diemen's Land

Posted 27 September 2017 - 03:27 AM

HOST

Dave-ee's DNS API



So, here's my super-simple and easy-to-use DNS API. Usage is very simple. All you need is a name of your choice, and a computer ID. BOOM! Done.

There's some more documentation in the API and the demo themselves, so if you get stuck just have a look at those! But there's some functions below..

Functions:
Spoiler

Errors:
Spoiler

So, as you can see it's very simple and easy to use. It's also extremely lightweight (under 100 lines of code with commenting), and so easy to incorporate into your OS' if you want to (which you are entirely free to do)!

What's the difference between RAM and FS editions?
Glad you asked! RAM Edition means that once the computer has rebooted you have to create all the DNS entries again. Could be useful, could be annoying, which is why I've created 2 different versions of this program.
FS Edition means that all entries are stored in a directory (default: ".hosts") and are referred to that way.


API Pastebin (RAM Edition):

pastebin get bhZ5Pi6Q host


API Pastebin (FS Edition):

pastebin get ruu0wpdw host


Demo Pastebin:

pastebin get fAriampD demo




FEEL FREE TO COMMENT BELOW YOUR FEEDBACK AND SUGGESTIONS!


Edited by Dave-ee Jones, 27 September 2017 - 05:14 AM.


#2 Dave-ee Jones

  • Members
  • 456 posts
  • LocationVan Diemen's Land

Posted 27 September 2017 - 03:44 AM

Quick fixes:
  • If you use 'dofile("host")' instead of 'os.loadAPI("host")' it now keeps the record entries globally so you can set them in one program and still use them for another. Might make it so it refers to a directory for entries so it works after restarts etc.
Major change:
  • 2 Editions (explained in OP)

Edited by Dave-ee Jones, 27 September 2017 - 05:13 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users