Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] resolv.conf no longer gets populated while booting
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1073

PostPosted: Sat Nov 16, 2019 6:31 pm    Post subject: [solved] resolv.conf no longer gets populated while booting Reply with quote

After a reboot on my server, which is configured with fixed IP, apparently net.eth0 does no longer add nameserver entries into resolv.conf.

resolv.conf looks like this then:

Code:
# Generated by net-scripts for interface lo
domain mydomain.com
search myhostersdomain.com


Code:
/etc/init.d/net.eth0 status
 * status: started


/etc/conf.d/net
Code:
config_eth0="123.456.789.87 netmask 255.255.255.0"
routes_eth0="default via 123.456.789.1"
dns_servers_eth0="127.0.0.1"
dns_search="myhosterdomain.com"
dns_domain_lo="mydomain.com"


But after restarting net.eth0 manually by issuing /etc/init.d/net.eth0 restart resolv.conf is populated with nameserver entries.

Where could that come from?

rc-update
Code:
rc-update
              apache2 |      default                           
               binfmt | boot                                   
             bootmisc | boot                                   
              cgroups |                                 sysinit
                clamd |      default                           
               cronie |      default                           
                devfs |                                 sysinit
                dmesg |                                 sysinit
              dovecot |      default                           
             fail2ban |      default                           
                 fsck | boot                                   
             hostname | boot                                   
              hwclock | boot                                   
             iptables |      default                           
              keymaps | boot                                   
            killprocs |                        shutdown       
    kmod-static-nodes |                                 sysinit
                local |      default nonetwork                 
           localmount | boot                                   
              loolwsd |      default                           
             loopback | boot                                   
              modules | boot                                   
             mount-ro |                        shutdown       
                 mtab | boot                                   
                mysql |      default                           
             net.eth0 |      default                           
             netmount |      default                           
                 ntpd |      default                           
     opentmpfiles-dev |                                 sysinit
   opentmpfiles-setup | boot                                   
 openvpn.srvnamevpnsrv |      default                           
              php-fpm |      default                           
              postfix |      default                           
               procfs | boot                                   
                redis |      default                           
                 root | boot                                   
               rspamd |      default                           
         save-keymaps | boot                                   
    save-termencoding | boot                                   
            savecache |                        shutdown       
                 sshd |      default                           
                 swap | boot                                   
               sysctl | boot                                   
                sysfs |                                 sysinit
            syslog-ng |      default                           
         termencoding | boot                                   
           turnserver |      default                           
                 udev |                                 sysinit
         udev-trigger |                                 sysinit
              unbound |      default                           
              urandom | boot

emerge --info
Code:
Portage 2.3.76 (python 3.6.9-final-0, default/linux/amd64/17.1/no-multilib, gcc-9.2.0, glibc-2.29-r2, 4.19.82-gentoo x86_64)
=================================================================
System uname: Linux-4.19.82-gentoo-x86_64-AMD_EPYC_Processor_-with_IBPB-with-gentoo-2.6
KiB Mem:     6103940 total,   3946596 free
KiB Swap:    6291452 total,   6291452 free
Timestamp of repository gentoo: Fri, 15 Nov 2019 16:30:01 +0000
Head commit of repository gentoo: eb8dbe94cae643c4db4fe1842ec03c6b5b607dee
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.32 p2) 2.32.0
app-shells/bash:          4.4_p23-r1::gentoo
dev-lang/perl:            5.28.2-r1::gentoo
dev-lang/python:          2.7.16::gentoo, 3.6.9::gentoo
dev-util/cmake:           3.14.6::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.41.2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo
sys-devel/gcc-config:     2.1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r2::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1

local_overlay
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.3/ext-active/ /etc/php/cgi-php7.3/ext-active/ /etc/php/cli-php7.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs candy config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_CH.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de de_DE el en fr fr_FR it tr"
MAKEOPTS="-j5"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="3dnow 3dnowext acl amd64 apache2 authdaemond berkdb bzip2 caps cgi clamav clamdtop cli crypt cryptsetup curl cxx device-mapper dkim dovecot-sasl dri exif fam fontconfig fortran fpm gd gdbm geoip iconv imap jpeg libmysqlclient libtirpc maildir managesieve mmx mmxext mysql mysqli ncurses nls nptl openmp pam pcntl pcre pdo png popcnt readline seccomp sieve sockets spell split-usr sqlite sse sse2 sse3 sse4_1 sse4a ssl symlink tcpd truetype unicode vhosts xattr xmlwriter xslt zip zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_core authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation proxy proxy_http proxy_wstunnel rewrite setenvif socache_shmcb speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" L10N="de el en fr it tr" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


dmesg

dns still works as ping google.ch translates correctly. Probably because of unbound. I got aware of this as starting rspamd service, I saw a message:

Code:
/etc/init.d/rspamd restart
cannot parse resolv.conf and no nameservers defined, so no ways to resolve addresses
 * Stopping rspamd ...                                                                                  [ ok ]
 * Starting rspamd ...                                                                                  [ ok ]


Last edited by Elleni on Sat Nov 16, 2019 10:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
freke
Guru
Guru


Joined: 23 Jan 2003
Posts: 588
Location: Somewhere in Denmark

PostPosted: Sat Nov 16, 2019 10:22 pm    Post subject: Reply with quote

I think that your resolv.conf got overwritten by bringing up net.lo.

I had this when installing rspamd - which in turn required redis, which in it's /etc/conf.d/redis (iirc) needs net.lo (which means that it'll get started if not running) - I changed that to need my net.Eth1 instead (as I also changed redis/the rspamd worker-controller to listen on that interface)
Back to top
View user's profile Send private message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1073

PostPosted: Sat Nov 16, 2019 10:56 pm    Post subject: Reply with quote

Perfect.
So I changed /etc/conf.d/redis to listen to net.eth0 here too.
I then added
listen = "net.eth0" to /etc/rspamd/worker-controller.inc

hoping that this is what you meant :lol:

Rebooting showed nameserver entry in resolv.conf as expected thus rspamd not complaining anymore that it could not parse resolv.conf.

Thanks :D
Back to top
View user's profile Send private message
freke
Guru
Guru


Joined: 23 Jan 2003
Posts: 588
Location: Somewhere in Denmark

PostPosted: Sat Nov 16, 2019 11:14 pm    Post subject: Reply with quote

Elleni wrote:
Perfect.
So I changed /etc/conf.d/redis to listen to net.eth0 here too.
I then added
listen = "net.eth0" to /etc/rspamd/worker-controller.inc

hoping that this is what you meant :lol:

Rebooting showed nameserver entry in resolv.conf as expected thus rspamd not complaining anymore that it could not parse resolv.conf.

Thanks :D


Not exactly,

You shouldn't edit /etc/rspamd/worker-controller.inc - it'll be overwritten with rpsamd-updates/re-emerges. Instead you'll want to edit/create /etc/rspamd/local.d/worker-controller.inc and have a line
Code:
bind_socket =
with the hostname or ip + port you wan't to listen on ie.
Code:
bind_socket = "mail.vlh.dk:11334";


in /etc/conf.d/redis I have
Code:
rc_need="net.Eth1"
because that's the interface providing the needed ip. (I've removed the rc_need="net.lo" line completely - dunno if you did that)
Back to top
View user's profile Send private message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1073

PostPosted: Sun Nov 17, 2019 2:45 am    Post subject: Reply with quote

Thanks again, I corrected according your suggestions
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum