Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-79714

[RHEL 9 BUG] dig ignores search domains when resolv.conf has the 'search' option set right after a fourth nameserver or sixth nameserver

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-9.5
    • bind
    • None
    • No
    • Moderate
    • rhel-net-perf
    • ssg_core_services
    • 5
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • x86_64
    • None

      What were you trying to do that didn't work?

      Using dig to resolve queries using the +search option.

      What is the impact of this issue to you?

      A third-party installer relies on dig and nslookup to get proper addresses from hostname for installation.

      Please provide the package NVR for which the bug is seen:

      bind-utils-9.16.23-24.el9_5.x86_64 (actually all bind-utils versions from RHEL 9 have this issue)

      How reproducible is this bug?:

      Always

      Steps to reproduce

      1. Edit /etc/resolv.conf have 4. 6  or more 'nameserver' options and then right after the last one add the 'search' option with two domains to observe the behavior
        eg:
      2. vi /etc/resolv.conf
        nameserver 127.0.0.1
        nameserver 127.0.0.1
        nameserver 127.0.0.1
        nameserver 127.0.0.1
        search test.domain.local domain.local
      3. Then run a strace to the dig command and filter sendmsg()
      4. strace -Tttvf -s 4096 -e trace=sendmsg -y dig rhel8 +search 2>&1 | grep sendmsg.*rhel8
      5. Observe behavior, repeat adding multiple 'nameserver' options

      Expected results

      [root@r95 ~]# strace -Tttvf -s 4096 -e trace=sendmsg -y dig rhel8 +search 2>&1 | grep sendmsg.*rhel8
      [pid  7812] 20:05:44.663558 sendmsg(20<socket:[44493]>, {msg_name={sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, msg_namelen=16, msg_iov=[{iov_base="\372\377\1 \0\1\0\0\0\0\0\1\5rhel8\4test\6domain\5local\0\0\1\0\1\0\0)\20\0\0\0\0\0\0\f\0\n\0\10\35,H\233\16F\327\325", iov_len=64}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 64 <0.000024>
      [pid  7812] 20:05:44.664891 sendmsg(20<socket:[44495]>, {msg_name={sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, msg_namelen=16, msg_iov=[{iov_base="Sn\1 \0\1\0\0\0\0\0\1\5rhel8\6domain\5local\0\0\1\0\1\0\0)\20\0\0\0\0\0\0\f\0\n\0\10\35,H\233\16F\327\325", iov_len=59}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 59 <0.000035>
      [pid  7812] 20:05:44.666076 sendmsg(20<socket:[44496]>, {msg_name={sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, msg_namelen=16, msg_iov=[{iov_base="\240\273\1 \0\1\0\0\0\0\0\1\5rhel8\0\0\1\0\1\0\0)\20\0\0\0\0\0\0\f\0\n\0\10\35,H\233\16F\327\325", iov_len=46}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 46 <0.000032>

      Actual results

      [root@r95 ~]# strace -Tttvf -s 4096 -e trace=sendmsg -y dig rhel8 +search 2>&1 | grep sendmsg.*rhel8
      [pid  7822] 20:07:20.667677 sendmsg(20<socket:[44513]>, {msg_name={sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, msg_namelen=16, msg_iov=[{iov_base="\212\334\1 \0\1\0\0\0\0\0\1\5rhel8\0\0\1\0\1\0\0)\20\0\0\0\0\0\0\f\0\n\0\10\342\361\300\245\375\226\314\255", iov_len=46}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 46 <0.000050>

      Additional information

      In gdb we can see search list being set as null,

      searchlist = {head = 0x0, tail = 0x0}

       

              pemensik@redhat.com Petr Mensik
              rhn-support-jgamba Juan Gamba
              Petr Mensik Petr Mensik
              rhel-cs-infra-services-qe rhel-cs-infra-services-qe rhel-cs-infra-services-qe rhel-cs-infra-services-qe
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: