elks-enhanced
public
Read
Owner: themaster
Branch: master
Commits: 6893
Updated: 2026-04-19 00:15
Git CLI clone URL
git clone https://www.xt-emporium.com/git/elks-enhanced.git
Fullscreen desktop URL
Code
Commits
History
Branches
Bug Reports
Discussions
Compare
Settings
elks-enhanced
/
elkscmd
/
inet
/
nslookup.c
File editor
/* * DNS Name Lookup */ #include <stdio.h> #include <unistd.h> #include <string.h> #include <arpa/inet.h> #define msg(str) write(STDOUT_FILENO, str, sizeof(str) - 1) #define msgstr(str) write(STDOUT_FILENO, str, strlen(str)) #define errmsg(str) write(STDERR_FILENO, str, sizeof(str) - 1) #define errstr(str) write(STDERR_FILENO, str, strlen(str)) int main(int ac, char **av) { ipaddr_t result; char *server = NULL; if (ac < 2) { errmsg("Usage: nslookup <domain> [nameserver]\n"); return 1; } if (ac > 2) server = av[2]; result = in_resolv(av[1], server); if (result) { msgstr(av[1]); msg(" is "); msgstr(in_ntoa(result)); msg("\n"); } else perror(av[1]); return (result == 0); }
Commit message
This repository is read-only for this account.
Repository snapshot
Current branch
master
Visibility
public
Your access
Read
Remote
Configured
File activity
View file history