
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
A DNS Server with an Web UI and using Redis a configuration store
brew install redis
sudo npm install -g dns
/usr/local/opt/redis/bin/redis-server /usr/local/etc/redis.conf >& /tmp/redis.log &
sudo dns >& /tmp/dns.log &
open http://localhost:8053
REDIS_PORT_6379_TCP_ADDR (default: 127.0.0.1)
REDIS_PORT_6379_TCP_PORT (default: 6379)
DNSINTERFACE (default: 0.0.0.0)
DNSPORT (default: 53 <- require root privilege to run)
DNSZONE (default: local.dev)
DNSTTL (default: 3600 <- one hour)
DNSPREFIX (default: "dns:" <- key prefix in redis)
DNSPRIMARY (default: 8.8.8.8)
DNSSECONDARY (default: 8.8.4.4)
DNSTIMEOUT (default: 1000 <- 1 second)
* GET /dns/api/v1/name
List all host to ip address mapping
* GET /dns/api/v1/name/{host}
Return the ip address of only that host
* PUT /dns/api/v1/name/{host}
Create or Modify the ip address for "host"
* DELETE /dns/api/v1/name/{host}
Remove the host from the DNS
* DELETE /dns/api/v1/name?force=true
Remove all host from the DNS
* GET /dns/api/v1/zone
Return the DNS ZONE
* GET /dns/api/v1/status
Return the DNS status
Single host
curl -X PUT -H 'Content-Type: application/json' -d '{"ipv4":["192.168.1.1"], "ipv6":["2605:f8b0:4006:802:0:0:0:1010"]}' http://localhost:8053/dns/api/v1/name/database.domain.com
Multiple hosts
curl -X PUT -H 'Content-Type: application/json' -d '{"ipv4":["192.168.1.1","192.168.1.2"], "ipv6":["2605:f8b0:4006:802:0:0:0:1010","2605:f8b0:4006:802:0:0:0:1011"]}' http://localhost:8053/dns/api/v1/name/database.domain.com
curl http://localhost:8053/dns/api/v1/name/database.domain.com
or
dig @127.0.0.1 database.domain.com
or
dig @127.0.0.1 database.domain.com AAAA
curl -X DELETE http://localhost:8053/dns/api/v1/name/database.domain.com
You will need to clear your redis configuration before running the new version.
curl -X DELETE http://localhost:8053/dns/api/v1/name\?force\=true
or
for key in `echo 'KEYS dns*' | redis-cli | awk '{print $1}'` ; do echo DEL $key ; done | redis-cli
FAQs
A DNS Server with a REST API
The npm package dns receives a total of 11,904 weekly downloads. As such, dns popularity was classified as popular.
We found that dns demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.