Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
93 lines
2.9 KiB
Bash
Executable File
93 lines
2.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Add hosts file entries and optionally configure Cloudflare DNS for local resolution.
|
|
# Fixes DNS_PROBE_FINISHED_NXDOMAIN when local/ISP DNS fails to resolve d-bis.org and defi-oracle.io domains.
|
|
# Run: sudo ./scripts/fix-local-dns-hosts.sh
|
|
|
|
set -euo pipefail
|
|
|
|
PUBLIC_IP="76.53.10.36"
|
|
HOSTS_FILE="/etc/hosts"
|
|
START_MARKER="# --- d-bis-defi-oracle-hosts-start ---"
|
|
END_MARKER="# --- d-bis-defi-oracle-hosts-end ---"
|
|
|
|
# Domains that resolve to NPMplus (76.53.10.36)
|
|
DOMAINS=(
|
|
"explorer.d-bis.org"
|
|
"explorer.defi-oracle.io"
|
|
"rpc-http-pub.d-bis.org"
|
|
"rpc-ws-pub.d-bis.org"
|
|
"rpc.d-bis.org"
|
|
"rpc2.d-bis.org"
|
|
"ws.rpc.d-bis.org"
|
|
"ws.rpc2.d-bis.org"
|
|
"rpc-http-prv.d-bis.org"
|
|
"rpc-ws-prv.d-bis.org"
|
|
"dbis-admin.d-bis.org"
|
|
"dbis-api.d-bis.org"
|
|
"dbis-api-2.d-bis.org"
|
|
"secure.d-bis.org"
|
|
"mim4u.org"
|
|
"www.mim4u.org"
|
|
"secure.mim4u.org"
|
|
"training.mim4u.org"
|
|
"rpc.public-0138.defi-oracle.io"
|
|
"rpc.defi-oracle.io"
|
|
"wss.defi-oracle.io"
|
|
)
|
|
|
|
# Check root
|
|
if [ "$(id -u)" -ne 0 ]; then
|
|
echo "This script needs root for /etc/hosts and /etc/resolv.conf."
|
|
echo "Run: sudo $0"
|
|
echo ""
|
|
echo "Or manually add to /etc/hosts (sudo nano /etc/hosts):"
|
|
echo ""
|
|
for domain in "${DOMAINS[@]}"; do
|
|
echo "$PUBLIC_IP $domain"
|
|
done
|
|
exit 1
|
|
fi
|
|
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
echo " Fix local DNS — hosts file + Cloudflare DNS"
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
echo ""
|
|
|
|
# 1. Remove old block if present
|
|
if grep -q "$START_MARKER" "$HOSTS_FILE" 2>/dev/null; then
|
|
echo "Removing existing d-bis/defi-oracle block..."
|
|
sed -i "/$START_MARKER/,/$END_MARKER/d" "$HOSTS_FILE"
|
|
fi
|
|
|
|
# 2. Add hosts entries
|
|
echo "Adding hosts entries for $PUBLIC_IP..."
|
|
echo "" >> "$HOSTS_FILE"
|
|
echo "$START_MARKER" >> "$HOSTS_FILE"
|
|
for domain in "${DOMAINS[@]}"; do
|
|
echo "$PUBLIC_IP $domain" >> "$HOSTS_FILE"
|
|
done
|
|
echo "$END_MARKER" >> "$HOSTS_FILE"
|
|
echo "" >> "$HOSTS_FILE"
|
|
echo "Added ${#DOMAINS[@]} entries."
|
|
echo ""
|
|
|
|
# 3. WSL: Configure Cloudflare DNS in resolv.conf (persists until WSL restart)
|
|
if [ -f /etc/wsl.conf ] 2>/dev/null || grep -q microsoft /proc/version 2>/dev/null; then
|
|
echo "WSL detected. Configuring Cloudflare DNS..."
|
|
if ! grep -q "generateResolvConf" /etc/wsl.conf 2>/dev/null; then
|
|
{ echo ""; echo "[network]"; echo "generateResolvConf = false"; } >> /etc/wsl.conf
|
|
echo "Added generateResolvConf = false to /etc/wsl.conf"
|
|
fi
|
|
cat > /etc/resolv.conf << 'EOF'
|
|
nameserver 1.1.1.1
|
|
nameserver 1.0.0.1
|
|
EOF
|
|
echo "Set /etc/resolv.conf to Cloudflare DNS (1.1.1.1, 1.0.0.1)"
|
|
else
|
|
echo "For Cloudflare DNS on Linux: add nameserver 1.1.1.1 to /etc/resolv.conf or use NetworkManager."
|
|
fi
|
|
|
|
echo ""
|
|
echo "Done. Test with: curl -sI https://explorer.d-bis.org/ | head -3"
|
|
echo ""
|