Parses queries and responses into dns class.