Multiple search domains in resolv.conf

jbygden

New Member
Dec 14, 2011
1
0
1
Hello!

We have multiple search domains in /etc/resolv.conf on the host, but only the first entry gets added to new OpenVZ containers.

I found the problem in /usr/share/perl5/PVE/INotify.pm, and have edited it to support more than one search domain:

Code:
*** INotify.pm    2011-12-14 15:06:16.597564469 +0100
--- INotify.pm.patched    2011-12-14 15:06:48.745792975 +0100
***************
*** 537,541 ****
      while (my $line = <$fh>) {
      chomp $line;
!     if ($line =~ m/^(search|domain)\s+(\S+)\s*/) {
          $res->{search} = $2;
      } elsif ($line =~ m/^nameserver\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s*/) {
--- 537,541 ----
      while (my $line = <$fh>) {
      chomp $line;
!     if ($line =~ m/^(search|domain)\s+(.+)/) {
          $res->{search} = $2;
      } elsif ($line =~ m/^nameserver\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s*/) {

Should I log this as a bug as well?

/Jonas
 
I literally just signed up this forum to tell you, that this bug is still a thing with LXC-Containers on Proxmox 6.3-3, and your solution still works fine.
Thank you very, very much for this. I cannot believe, why a bug like this is not fixed after 10(!!) Years, when the Solution has already been provided.
 
same thing on last stable proxmox 7.1 on Apr 2022....
11 years for a one line change...