Coder Social home page Coder Social logo

DNSFORWARDER issue about samba-domain HOT 13 CLOSED

tbs575 avatar tbs575 commented on August 15, 2024
DNSFORWARDER issue

from samba-domain.

Comments (13)

systemofapwne avatar systemofapwne commented on August 15, 2024 3

This is indeed a bug in the init.sh script: By default, it adds the containers default DNS resolver, which is the docker DNS resolver. If DNSFORWARDER is set, it replaces

[global]

with

[global] dns forwarder = ....

But the culprit is, that another entry of "dns forwarder" is yet down the lines of the CFG, which will nullify the settings above and thus default back to the containers DNS resolver.

In order to fix this, init.sh only needs this additional line being added after

if [[ $DNSFORWARDER != "NONE" ]]; then

sed -i "/dns forwarder/d" /etc/samba/smb.conf

This will first delete every single occurance of "dns forwarder" being generated by the previous commands, before adding the "dns forwarder" stated in the env DNSFORWARDER

from samba-domain.

antonioj-mattos avatar antonioj-mattos commented on August 15, 2024 1

Hi @tbs575

I've had a similar problem, then looking at the config file at /var/lib/samba/config/samba/ I noticed the setting was being overridden at some point

[global]
        dns forwarder = 10.109.50.22
        idmap_ldb:use rfc2307 = yes
                        wins support = yes
 
        server role = active directory domain controller
        dns forwarder = 127.0.0.11  # <--- redefinition

It worked after I comment out the second definition.

from samba-domain.

mtcoffee avatar mtcoffee commented on August 15, 2024

Hi @tbs575

I've had a similar problem, then looking at the config file at /var/lib/samba/config/samba/ I noticed the setting was being overridden at some point

[global]
        dns forwarder = 10.109.50.22
        idmap_ldb:use rfc2307 = yes
                        wins support = yes
 
        server role = active directory domain controller
        dns forwarder = 127.0.0.11  # <--- redefinition

It worked after I comment out the second definition.

Had the same issue but in /etc/smb.conf

from samba-domain.

Fmstrat avatar Fmstrat commented on August 15, 2024

@meatsac @tbs575 Are either of you using an external config? Can you send in your compose file? I think this may be related to the cp issue, or it's getting replaced on provision.

from samba-domain.

sasa-friedrich-bitlab avatar sasa-friedrich-bitlab commented on August 15, 2024

I can confirm same thing (dns forwarder written twice). Here is my docker-compose.yml:

version: '2'

networks:
  samba-pdc:
    external: true

services:

  samba:
    image: samba-domain:latest
    container_name: samba-dc
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./data/:/var/lib/samba
      - ./config/:/etc/samba/external
    environment:
      - DOMAIN=TEST.LOCAL
      - NOCOMPLEXITY=true
      - DOMAINPASS=test123
      - DNSFORWARDER=8.8.8.8
      - HOSTIP=192.168.100.2
    networks:
      - samba-pdc
    ports:
      - 192.168.100.2:53:53
      - 192.168.100.2:53:53/udp
      - 192.168.100.2:88:88
      - 192.168.100.2:88:88/udp
      - 192.168.100.2:135:135
      - 192.168.100.2:137-138:137-138/udp
      - 192.168.100.2:139:139
      - 192.168.100.2:389:389
      - 192.168.100.2:389:389/udp
      - 192.168.100.2:445:445
      - 192.168.100.2:464:464
      - 192.168.100.2:464:464/udp
      - 192.168.100.2:636:636
      - 192.168.100.2:1024-1044:1024-1044
      - 192.168.100.2:3268-3269:3268-3269
    dns_search:
      - test.local
    dns:
      - 192.168.100.2
      - 192.168.100.1
    extra_hosts:
      - dc.test.local:192.168.100.2
    hostname: dc
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun
    privileged: true
    restart: always

from samba-domain.

cadeon avatar cadeon commented on August 15, 2024

Me too, dns forwarder twice in the external smb.conf, with two different values. However - for me, commenting the second entry doesn't change behavior.

Getting shell into the container shows the issue exists in /etc/samba/smb.conf and /etc/samba/external/smb.conf. I have external mapped as a volume and was correcting the external version, but it wasn't being copied over. I manually copied it over in the container, and now we're forwarding.

from samba-domain.

mvthul avatar mvthul commented on August 15, 2024

How can I fix this permanently? Wich one to edit and were I see 3 smb.conf locations in this thread xD

from samba-domain.

mvthul avatar mvthul commented on August 15, 2024

How can I fix this my setup just isn’t Forward queries that can not be answered from own zones.
Cant resolve example bing.com somehow

from samba-domain.

mvthul avatar mvthul commented on August 15, 2024

Okee I remove the second entry only in sed -i "/dns forwarder = dcipaddress" /etc/samba/smb.conf and changed the smb.conf in the samba/config/samba/smb.conf to the forwarded ip

from samba-domain.

infeeeee avatar infeeeee commented on August 15, 2024

This bug is not resolved yet.

@systemofapwne can you create a PR? is it ok for you if I create it?

from samba-domain.

systemofapwne avatar systemofapwne commented on August 15, 2024

This bug is not resolved yet.

@systemofapwne can you create a PR? is it ok for you if I create it?

Please create a PR yourself. I am not using this container anymore, since it gave me too much headaches and was using an outdated Samba version for quite some time. I fully migrated to a VM running Univention UCS for my AD.

from samba-domain.

helgeklein avatar helgeklein commented on August 15, 2024

This is still unfixed.

from samba-domain.

frasou avatar frasou commented on August 15, 2024

This is still unfixed.

First of all, try develop branch. Many issues are "solved" there. Master is quite outdated and full of bugs. I don't know the reason though, why maintainer has not merged it to master.

from samba-domain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.