Unverified Commit 374b4d90 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

feat: Use local dns resolver for passt (#873)

parent 9f2d3755
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -298,7 +298,6 @@ configureSlirp() {
  [ -n "$forward" ] && NET_OPTS+=",$forward"

  if [[ "${DNSMASQ_DISABLE:-}" != [Yy1]* ]]; then
    # Force local DNS to dnsmasq as slirp provides no way to set it
    cp /etc/resolv.conf /etc/resolv.dnsmasq
    echo -e "nameserver 127.0.0.1\nsearch .\noptions ndots:0" >/etc/resolv.conf
    configureDNS "lo" "$ip" "$VM_NET_MAC" "$VM_NET_HOST" "$VM_NET_MASK" "$gateway" || return 1
@@ -350,16 +349,15 @@ configurePasst() {
  PASST_OPTS+=" -u $exclude"
  PASST_OPTS+=" -H $VM_NET_HOST"
  PASST_OPTS+=" -M $VM_NET_MAC"

  if [[ "${DNSMASQ_DISABLE:-}" != [Yy1]* ]]; then
    PASST_OPTS+=" --dns-forward $gateway"
    PASST_OPTS+=" --dns-host 127.0.0.1"
  fi

  PASST_OPTS+=" -P /var/run/passt.pid"
  PASST_OPTS+=" -l $log"
  PASST_OPTS+=" -q"

  if [[ "${DNSMASQ_DISABLE:-}" != [Yy1]* ]]; then
    cp /etc/resolv.conf /etc/resolv.dnsmasq
    echo -e "nameserver 127.0.0.1\nsearch .\noptions ndots:0" >/etc/resolv.conf
  fi

  PASST_OPTS=$(echo "$PASST_OPTS" | sed 's/\t/ /g' | tr -s ' ' | sed 's/^ *//')
  [[ "$DEBUG" == [Yy1]* ]] && printf "Passt arguments:\n\n%s\n\n" "${PASST_OPTS// -/$'\n-'}"