-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add setup.sh script to create initial records in primary dns #3
Conversation
Doing some more debugging: / # dig @10.5.0.20 starchart.com
; <<>> DiG 9.16.33 <<>> @10.5.0.20 starchart.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 61456
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;starchart.com. IN A
;; Query time: 3 msec
;; SERVER: 10.5.0.20#53(10.5.0.20)
;; WHEN: Sun Nov 27 16:54:22 UTC 2022
;; MSG SIZE rcvd: 42 Based on |
Actually, I think it's working. Here I can get the IP for # dig @10.5.0.20 www.starchart.com
; <<>> DiG 9.16.33 <<>> @10.5.0.20 www.starchart.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18321
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.starchart.com. IN A
;; ANSWER SECTION:
www.starchart.com. 3600 IN A 10.5.0.100
;; Query time: 9 msec
;; SERVER: 10.5.0.20#53(10.5.0.20)
;; WHEN: Sun Nov 27 17:09:22 UTC 2022
;; MSG SIZE rcvd: 62 Also: / # nslookup www.starchart.com
Server: 127.0.0.11
Address: 127.0.0.11#53
Name: www.starchart.com
Address: 10.5.0.100 And, I can get the web page from the nginx container via the domain name: # curl http://www.starchart.com
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html> Do make this work, I had to alter the web-server:
container_name: web
image: nginx:stable-alpine
expose:
- "80"
dns:
# Use the primary dns server
- 10.5.0.20
- 8.8.8.8
networks:
private_net:
ipv4_address: 10.5.0.100 I then did the following so I had the proper network access and tools within the web container: $ docker exec -it web /bin/sh
/ # apk add bind-tools
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/aarch64/APKINDEX.tar.gz
(1/11) Installing fstrm (0.6.1-r0)
(2/11) Installing krb5-conf (1.0-r2)
(3/11) Installing libcom_err (1.46.2-r0)
(4/11) Installing keyutils-libs (1.6.3-r0)
(5/11) Installing libverto (0.3.2-r0)
(6/11) Installing krb5-libs (1.18.5-r0)
(7/11) Installing json-c (0.15-r1)
(8/11) Installing protobuf-c (1.3.3-r6)
(9/11) Installing libuv (1.41.0-r0)
(10/11) Installing bind-libs (9.16.33-r0)
(11/11) Installing bind-tools (9.16.33-r0)
Executing busybox-1.33.1-r6.trigger
OK: 30 MiB in 53 packages Then I could experiment with the domains. If I switch the DNS so it uses the secondary (10.5.0.80) instead, it can't get the record (i.e., it hasn't replicated to the secondary). So I'm closer than I thought, but still stuck on the right way to arrange all this. |
I have a basic demo working now, and I've recorded a short video to show what this does (cc @mehrdadziaei): https://www.youtube.com/watch?v=Xa7vx3GCXX8 I think this is going to work :). Now I have something to demo to the students in January. @ctyler, I'm going to split the DNS primary/secondary syncing off to another issue and deal with it later. I can't get it to work, and I suspect you would be able to do it if we spent some time on it over a call or something later on (it's not critical for development). |
Switched to use I also tried 75,000 things to get the replication work, but I have no idea what's wrong. |
I think I should merge this to a Are people OK with this? |
Closing this, since we don't need it going forward. If anyone wants it, the branch is on my fork. |
* fix DevelopingSpace#2 * fix DevelopingSpace#3 * Use unique Job Id in notifications worker * fixes DevelopingSpace#5
Fixes #2.
This isn't complete yet, but I made more progress, and now it can create all the necessary records. The replication to the secondary DNS is sort-of working, but I get an error.
To test this, do the following:
First, running the three containers together:
Next, in a second shell, run the
setup.sh
script on theprimary
DNS conatiner:Notice the logs in the primary and secondary DNS containers as this happens:
So it's seeing the primary is notifying the secondary, and it tries to get the details, but
10.5.0.20
doesn't respond to the query for some reason.I suspect it's something to do with PowerDNS not being the DNS running on that instance (i.e., my Docker host is likely providing the DNS instead). I'm not sure how to override.