{"_id":"@cepharum/swarm-dns","_rev":"1-6ae5cd95149c7a8362afa9a5ad2e9f68","name":"@cepharum/swarm-dns","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.1":{"name":"@cepharum/swarm-dns","version":"0.1.1","description":"a simple DNS service for Docker Swarm","main":"server.js","scripts":{"start":"node server.js"},"keywords":[],"author":{"name":"Thomas Urban","email":"thomas.urban@cepharum.de"},"license":"MIT","dependencies":{"@cepharum/dnsd":"^0.10.2"},"repository":{"url":"git+https://gitlab.com/cepharum-foss/swarm-dns.git"},"gitHead":"f08328ad6cbb97f5908fe50ea4c0105d6f0111fe","bugs":{"url":"https://gitlab.com/cepharum-foss/swarm-dns/issues"},"homepage":"https://gitlab.com/cepharum-foss/swarm-dns#readme","_id":"@cepharum/swarm-dns@0.1.1","_nodeVersion":"12.19.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-0uYCsbKE5ZZVTGuwnb52zhzm+KsC/hVDy6vdmaNb5GwKrEtfQjj9QWFD6d15IK7iziq3qkmDndt1fIlVCo2xPA==","shasum":"8c596b9fb8ef3ca61890b0d084c2a41c93a9333a","tarball":"https://registry.npmjs.org/@cepharum/swarm-dns/-/swarm-dns-0.1.1.tgz","fileCount":10,"unpackedSize":25798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsluLCRA9TVsSAnZWagAAakEP/1e89+fyJFCGECqQsP0J\nOVn2FbYCEFPegEU+8HskwhAJNdQ+gV2KhZe/8H6pLqAJ8NRSPmIe466wLVrJ\nPxgs3o0arY2K4On+PJEiXsyJuLk3cYmXKreXdoRewsLz2K8Dvf1iMuvfkwuS\n5LAcRqVg448r2yuJIdj2uO8xqD2wr6GwyU9swabIDnIpy/3DMIetvQ7DLO8i\npdt0jHaSE/HLCvc3h4CcC/jgsKYdJxa/UTQOdg9qvROSZdEV50zBiq59OBAh\nGV84j3q73qDNy4+lIuj0zlKjQkmE5zwLZnKQnRgkGeGEpKsdvE7ZULyHBa51\nSJ/jYVVNylKkDw1YimspfQoo4lxRlkHouLQ6j65r/KQgnxJkCYLJ1VStOGk2\nEy1VGRRAYUb/ijrckFp1VWDbFvTjjcD3THP5XDqqHd6TLWpHUc9H0rIZfQnV\no8AWFgIK//Q8p1mXbwpvdyTt7dzWkE/RhPGHsm8i0S59q53hunVFscWQ0VUY\n05HPwW4kCTCLvFYfmMjkFv4Iu6UJjwbN8ipBveojdCX2UAQ4bS/tKHZ4WkMc\nqJLFiZ4oUUMBdEBiDmuQ3dg83hVbqnton5WCwxrrJFK2EprAyDO3FyYEjJ9H\nNFMmlbK7pYCanLHdfrdXUqUJhfCH/hPv/6LDassX59jgqtCr2LfgdnHztESo\n9dgB\r\n=pyDl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD41lhxkVzX+VhfaelQUIgHovy/VejbKF2HXyC/xH0znAIgcxizirYWU09PYPutdkgw1F7xmt7as0c8XOtGKh43rEQ="}]},"_npmUser":{"name":"soletan","email":"thomas.urban@cepharum.de"},"directories":{},"maintainers":[{"name":"simon.friedo","email":"friedosimon@aol.com"},{"name":"soletan","email":"thomas.urban@cepharum.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/swarm-dns_0.1.1_1605524362586_0.16891168410716917"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-16T10:59:22.504Z","0.1.1":"2020-11-16T10:59:22.739Z","modified":"2022-04-04T22:20:26.024Z"},"maintainers":[{"name":"simon.friedo","email":"friedosimon@aol.com"},{"name":"soletan","email":"thomas.urban@cepharum.de"}],"description":"a simple DNS service for Docker Swarm","homepage":"https://gitlab.com/cepharum-foss/swarm-dns#readme","keywords":[],"repository":{"url":"git+https://gitlab.com/cepharum-foss/swarm-dns.git"},"author":{"name":"Thomas Urban","email":"thomas.urban@cepharum.de"},"bugs":{"url":"https://gitlab.com/cepharum-foss/swarm-dns/issues"},"license":"MIT","readme":"# Swarm DNS\n\nImplements DNS service for use in combination with a Docker Swarm responding with list of active swarm nodes on every request for some A record.\n\n## License\n\nMIT\n\n## Credits\n\nThis project has been inspired by [https://github.com/djmaze/swarmdns](https://github.com/djmaze/swarmdns).\n\nHowever, integrating DNS service with swarm nodes didn't work well, e.g. response times were pretty high and lots of queries got lost. So we decided to separate the DNS service from the swarm using status information provided by [different service](https://github.com/cepharum/swarm-status) there.\n\n## Usage\n\nYou should perform the following steps on at least two servers prepared to run docker containers at least.\n\n1. Pick a server to be one of your swarm's DNS servers.\n\n2. Create a script **run.sh** and paste content of [run.sh](run.sh).\n   \n3. Adjust the listed environment variables to suit your particular environment.\n\n   * `YOUR_IP` **should** provide the public IP address of your docker-enabled host to listen on for incoming requests. You may keep it unset for using current IP of `eth0`.\n\n   * `STATUS_PROVIDER` **must** contain public URL of running [swarm-status service](https://github.com/cepharum/swarm-status) or some compatible API.\n\n   * `LOCAL_NS` **must** contain comma-separated list of all your swarm's DNS servers' fully qualified domain names. \n   \n      The service is processing this information in response to requests for NS or SOA records.\n\n   * `UPDATE_INTERVAL` **may** be used to control interval in seconds to check _swarm status service_ for updated list of active swarm nodes. It is 10 seconds by default.\n\n   * `TRUSTED_NS` **may** be set to enable additional security feature. It is meant to list one or more IP addresses of trusted name servers. \n   \n     For every incoming request queried names are forwarded to these name servers to discover whether this service is authoritative or not. On successful response from listed name servers this service is responding to the original request with the list of all active swarm nodes. Otherwise it is responding without any data. \n     \n     The response data provided by name servers isn't inspected in detail for it is assumed to refer to this service anyway.\n     \n     By default, this list of name servers is empty resulting in this service always responding to incoming requests.\n     \n     Results of looking up name servers are cached locally with TTL provided by name servers. If TTL is missing a default of 300 seconds is assumed.\n      \n   * `TRUSTED_ACCEPT_NODATA` is a boolean switch that **may** be used to prevent the service's default behaviour of assuming that answers without data - empty answers - are referrals to some name server and thus basically confirming this service being authoritative. \n   \n     It is set by default and may be unset using some non-empty string which isn't evaluating as a truthy information.\n\n   * `TRUSTED_REJECT_TIMEOUT` is another boolean switch that **may** be adjusted to consider timeouts on looking up trusted name servers being intentional for those name servers don't feel authoritative for requested name thus discouraging clients from ever asking again. \n   \n     This option is enabled by default. So this service is assuming not to be authoritative for some incoming request if querying listed name servers times out. Otherwise, it is considering the timeout to be an error situation causing slightly different handling with regards to internal query caching.\n\n4. Invoke the script to start the service eventually.\n\n## Option: Using docker-compose\n\nThere is a option prepared to run the service with docker-compose instead of running custom script.\n\n1. Create file **.env** on either server meant to answer DNS queries for your swarm. Put content found in [.env.dist](.env.dist) there and adjust it according to your setup.\n\n2. Put file **docker-compose.yml** into the same folder with content found in [docker-compose.yml](docker-compose.yml).\n\n3. Invoke `docker-compose up -d` for starting the service.\n\n## Integration\n\nRunning this service isn't sufficient to get some working DNS infrastructure for your swarm-based services. In addition you need to have NS records in public DNS referring to this service on queries for domains to be managed in your swarm. \n\nThis strongly depends on your particular domain provider and thus isn't covered in this short introduction.\n","readmeFilename":"README.md"}