Resolve hostname to localhost
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/safing/portbase/log"
|
||||
@@ -46,6 +47,12 @@ func start() error {
|
||||
return fmt.Errorf("failed to parse nameserver listen address: %w", err)
|
||||
}
|
||||
|
||||
hostname, err = os.Hostname()
|
||||
if err != nil {
|
||||
log.Warningf("nameserver: failed to get hostname: %s", err)
|
||||
}
|
||||
hostname += "."
|
||||
|
||||
// Start listener(s).
|
||||
if ip2 == nil {
|
||||
// Start a single listener.
|
||||
|
||||
Reference in New Issue
Block a user