lancachenet / lancache-dns

DNS Docker service for a lancache.
https://hub.docker.com/r/lancachenet/lancache-dns/
MIT License
280 stars 73 forks source link

add the ability to use custom domains #102

Closed miketweaver closed 3 years ago

miketweaver commented 4 years ago

With this change, it provides the user the optional ability to use custom DNS overrides. This is useful for providing domain names to local caching services.

How do you use this?

  1. Create your container with a special bind mount. I my case I used: -v $(pwd)/custom.db:/etc/bind/cache/custom.db

  2. Create your override file. In my case it looked like this:

    notes.hackerlan.party           A       10.42.0.230
    games.hackerlan.party           A       10.42.0.230
    file-server.hackerlan.party     A       10.42.0.231
    dns.hackerlan.party             A       10.42.0.232
    cache.hackerlan.party           A       10.42.0.233
    quake.hackerlan.party           A       10.42.0.250

That's it.

Evidence it works:

$ dig @10.42.0.232 quake.hackerlan.party

; <<>> DiG 9.11.3-1ubuntu1.9-Ubuntu <<>> @10.42.0.232 quake.hackerlan.party
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39338
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: bb3f67a5def99fdc6b59e4965dd8dffe77db4ce618fb5ab9 (good)
;; QUESTION SECTION:
;quake.hackerlan.party.         IN      A

;; ANSWER SECTION:
quake.hackerlan.party.  5       IN      A       10.42.0.250

;; AUTHORITY SECTION:
rpz.                    60      IN      NS      localhost.

;; Query time: 4 msec
;; SERVER: 10.42.0.232#53(10.42.0.232)
;; WHEN: Sat Nov 23 00:30:05 MST 2019
;; MSG SIZE  rcvd: 120

Note: this is optional. If you do nothing different, it should continue to work as it did before. The $INCULDE will include a file that does not exist, as such your zone file will be unchanged.

VibroAxe commented 4 years ago

I like the feature, but this could probably do with some documentation. Could you add a section to the end of the README file explaining how to use and we'll accept the PR

miketweaver commented 4 years ago

@VibroAxe Ok. That documentation has been added.

miketweaver commented 4 years ago

@VibroAxe Let me know if there is anything else you would like me to add to this.

miketweaver commented 4 years ago

After some more research, I see that you have moved the documentation for the container to your website.

I've moved my documentation to there: https://github.com/lancachenet/lancachenet.github.io/pull/23

miketweaver commented 3 years ago

I just went and re-verifed that this works, even 8 months later.

Any chance of accepting this?

VibroAxe commented 3 years ago

@miketweaver apologies, I'm not sure how this got left by the way side. It looks good thanks for the PR and effort getting this one in