I haven't implemented the dns cache, typically most of the attributes to configure it are exposed as global parameters. But maybe some of them can be changed only via RPC. There is a module cfg_db which was supposed to allow loading values from database as well, but somehow the developer (which was in the SER project) left and is rather undocumented.
The parameters available in so called cfg reload framework can be set via kamcmd, like:
kamcmd cfg.set_now_int core cache_rec_pref 1
I've tried "kamcmd cfg.set_now_int core dns_cache_rec_pref 1". The cmd works and the value is changed accordingly. I also tried with other params like dns_cache_max_ttl and it works.
On the other hand, can you try adding in config file:
core.cache_rec_pref=1
at the beginning, in the part with global parameters?
I get a config error when setting the core.(dns_)cache_rec_pref=1 in config file:
"Apr 20 06:48:03 test-reg1-bs kamailio_3: ERROR: <core> [cfg/cfg.c:162]: cfg_declare(): ERROR: register_cfg_def(): configuration group has been already declared: core Apr 20 06:48:03 test-reg1-bs kamailio_3: ERROR: <core> [cfg/cfg.c:188]: cfg_declare(): ERROR: register_cfg_def(): Failed to register the config group: core Apr 20 06:48:03 test-reg1-bs kamailio_3: : <core> [main.c:2407]: main(): could not declare the core configuration"
If I try "cfg.cache_rec_pref=1" I get no errors but no effect.
If you have a patch, send it here or make a pull request on github. It will be accepted.
I have attached to this mail, the proposed patch which allows dns_cache_rec_pref to be set in config file. (i.e. dns_cache_rec_pref=1)
Kind Regards, Stefan