ask about bind9 logging function: How can I log the service port number (eg. 53, 443, 853) in my log of `queries` category

n/a cyberfoxmeow at proton.me
Tue Nov 26 09:08:47 UTC 2024


Hello,
I am a new user in bind9.

I have setup my DNS server with port 53, port 443 (DoH), and port 853 (DoT). And now, in my logging file of `queries` category, one query example shows as below:


    26-Nov-2024 03:55:41.524 queries: info: client @0x7f21ba9b3000 111.11.11.109#61713 (ust.hk): query: ust.hk IN A +E(0)TK (111.111.111.999)

For the `queries` log like this, how can I print the service port number used by the client? For example, for this `queries` log, what I want to get is with the service port number as below:
    26-Nov-2024 03:55:41.524 queries: info: client @0x7f21ba9b3000 111.11.11.109#61713 (ust.hk): query: ust.hk IN A +E(0)TK (111.111.111.999#443)
    26-Nov-2024 03:55:41.524 queries: info: client @0x7f21ba9b3000 111.11.11.109#61713 (ust.hk): query: ust.hk IN A +E(0)TK (111.111.111.999#853)
    26-Nov-2024 03:55:41.524 queries: info: client @0x7f21ba9b3000 111.11.11.109#61713 (ust.hk): query: ust.hk IN A +E(0)K (111.111.111.999#53)


How should I set up the logging config options to log the service port number? 


I have searched for this question on Google, and asked ChatGPT, but I only got answers to use other tools, like tcpdump. Is it possible to just config bind9 named.conf.* for this?


Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20241126/f591c72a/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: publickey - cyberfoxmeow at proton.me - 0x8221F940.asc
Type: application/pgp-keys
Size: 657 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20241126/f591c72a/attachment-0001.asc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20241126/f591c72a/attachment-0001.sig>


More information about the bind-users mailing list