How to get the systemd resolver to resolve local (i.e. unqalified) names?

Xen list at xenhideout.nl
Sun Jun 4 08:01:52 UTC 2017


Xen schreef op 04-06-2017 9:46:

> So that actually took me 15 minutes to get that working, because
> systemd is so awesome.

Actually that took me half an hour to get a simple mail being sent.

Had I done this with a cron job that checked the date being newer than 
cron job minus run interval, I would probably have been done in 5 
minutes.

Yup, here it is:

*/5 * * * *     /bin/sh -c 'test $(stat -c \%Z /etc/resolv.conf) -le $(( 
$(date +\%s) - 5*60 )) || echo | /usr/bin/mail -s again root'

Works like a charm.




More information about the ubuntu-users mailing list