5.3 C
New York
Saturday, March 22, 2025

Can a linux bridge have a DNS completely different from the host?


I’m utilizing Variety on my workstation, Variety creates a community bridge for itself and makes use of it to supply community performance to its Kubernetes [container] nodes

You’ll be able to see it right here:

ip route present

172.18.0.0/16 dev br-8bda417f3092 proto kernel scope hyperlink src 172.18.0.1

I’ve two nodes for Kubernetes, and you’ll see they’re related to the bridge

brctl present 

bridge title bridge id    STP enabled            interfaces
br-8bda417f3092     8000.be7a2df56498   no      vetha4f541f
                                                vethfa4fa91

Right here is the content material of /and so forth/resolv.conf for the Kubernetes nodes:

 # Generated by Docker Engine.
# This file might be edited; Docker Engine won't make additional modifications as soon as it
# has been modified.

nameserver 172.18.0.1
search .
choices edns0 trust-ad ndots:0

# Primarily based on host file: '/and so forth/resolv.conf' (inside resolver)
# ExtServers: [192.168.230.159]
# Overrides: [nameservers]
# Choice ndots from: inside

I need to change the DNS of the bridge machine i.e., br-8bda417f3092 from my workstation in order that the Variety Kubernetes nodes use a unique DNS nameserver. to do that, I created a file in /and so forth/systemd/community/br-8bda417f3092.community and the content material of the file is:

[Match]
Identify=br-8bda417f3092

[Network]
Deal with=172.18.0.1/16
DNS=185.51.200.2

I restarted the systemd-networkd.service and right here is the standing of br-8bda417f3092

sudo resolvectl standing br-8bda417f3092 

Hyperlink 8 (br-8bda417f3092)
    Present Scopes: DNS
         Protocols: +DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
       DNS Servers: 185.51.200.2

The issue is now My Variety nodes are unable to resolve any title, for instance if I SSH into certainly one of them and attempt to resolve any title I get this:

nslookup google.com

;; Obtained SERVFAIL reply from 172.18.0.1
Server:     172.18.0.1
Deal with:    172.18.0.1#53

** server cannot discover google.com: SERVFAIL

I affirm that the DNS server 185.51.200.2 works appropriately. once I configure this DNS server on my workstation, I can efficiently resolve all domains from the workstation itself.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles