GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
From: Alviro Iskandar Setiawan <[email protected]>
To: Ammar Faizi <[email protected]>,
	Michael William Jonathan <[email protected]>
Cc: Alviro Iskandar Setiawan <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>
Subject: [PATCH server-haj002 v1 3/6] mastodon: Fix DNS resolution error
Date: Thu, 13 Jul 2023 17:28:47 +0200	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

The default DNS system is not properly configured in this environment
and it leads to DNS resolution error. Provide custom resolv.conf file
and hosts file to satisfy the need of mastodon container.

The custom resolv.conf script will use the host IP address as the DNS
server. Therefore, the host must provide a working DNS server. It can
simply be done by adding these two lines to /etc/systemd/resolved.conf

   DNSStubListenerExtra=0.0.0.0:53
   DNSStubListenerExtra=[::]:53

Signed-off-by: Alviro Iskandar Setiawan <[email protected]>
---
 mastodon/docker-compose.example.yml | 2 ++
 mastodon/hosts                      | 8 ++++++++
 mastodon/resolv.conf                | 3 +++
 3 files changed, 13 insertions(+)
 create mode 100644 mastodon/hosts
 create mode 100644 mastodon/resolv.conf

diff --git a/mastodon/docker-compose.example.yml b/mastodon/docker-compose.example.yml
index e695b0a..769800f 100644
--- a/mastodon/docker-compose.example.yml
+++ b/mastodon/docker-compose.example.yml
@@ -94,3 +94,5 @@ services:
       - DB_POOL=5 #optional
     volumes:
       - /opt/mastodon/mastodon/config:/config
+      - ./resolv.conf:/etc/resolv.conf
+      - ./hosts:/etc/hosts
diff --git a/mastodon/hosts b/mastodon/hosts
new file mode 100644
index 0000000..23c9d56
--- /dev/null
+++ b/mastodon/hosts
@@ -0,0 +1,8 @@
+127.0.0.1	localhost
+::1		localhost ip6-localhost ip6-loopback
+fe00::0		ip6-localnet
+ff00::0		ip6-mcastprefix
+ff02::1		ip6-allnodes
+ff02::2		ip6-allrouters
+10.4.4.2	social social.gnuweeb.org
+51.81.211.47	mail1.gnuweeb.org
diff --git a/mastodon/resolv.conf b/mastodon/resolv.conf
new file mode 100644
index 0000000..2adb825
--- /dev/null
+++ b/mastodon/resolv.conf
@@ -0,0 +1,3 @@
+nameserver 10.4.4.1
+nameserver 8.8.8.8
+nameserver 8.8.4.4
-- 
Alviro Iskandar Setiawan


  parent reply	other threads:[~2023-07-13 15:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13 15:28 [PATCH server-haj002 v1 0/6] Server update and new service elk.gnuweeb.org Alviro Iskandar Setiawan
2023-07-13 15:28 ` [PATCH server-haj002 v1 1/6] init_net: Allow trusted traffic from/to local addresses Alviro Iskandar Setiawan
2023-07-13 15:28 ` [PATCH server-haj002 v1 2/6] mastodon: Enable IPv6 for the masto-net network Alviro Iskandar Setiawan
2023-07-13 15:28 ` Alviro Iskandar Setiawan [this message]
2023-07-13 15:28 ` [PATCH server-haj002 v1 4/6] mastodon: Move data directory inside the git project Alviro Iskandar Setiawan
2023-07-13 15:28 ` [PATCH server-haj002 v1 5/6] Add elk server using docker Alviro Iskandar Setiawan
2023-07-13 15:28 ` [PATCH server-haj002 v1 6/6] setup.txt: Add elk setup instructions Alviro Iskandar Setiawan
2023-07-13 15:42 ` [PATCH server-haj002 v1 0/6] Server update and new service elk.gnuweeb.org Ammar Faizi
2023-07-13 16:47   ` Alviro Iskandar Setiawan
2023-07-13 16:54     ` Ammar Faizi
2023-07-14  2:25       ` Michael William Jonathan
2023-07-14 10:32         ` Alviro Iskandar Setiawan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox