Configure DNS logging Time zone to UTC

binddomain-name-systemloggingtimezoneutc

I want to print DNS log into a file. However, my server time zone is GMT +7 and I'm not allowed to change its time zone to UTC.

Could we configure the DNS (ISC BIND 9.10.x) to use the UTC Time zone, instead of local system time zone?

logging {
  channel simple_log {
  file "/var/log/named/bind.log" versions 3 size 5m;
  severity warning;
  print-time yes;
  print-severity yes;
  print-category yes;
 };
category default{
  simple_log;
 };
};

Update:

From @GauravKansal comment, I can make the DNS uses the UTC time zone by running it in chroot environment. It might be not a best solution but it at least can help.

When running the DNS in chroot environment, it can not get the local system timezone. Then it will use the UTC as default.

Best Answer

Copy cp /etc/localtime /var/lib/named/etc/localtime

Change paths depending your chroot enviroment Should fix your problem