split dns-related functions to a dedicated module