adding mysql queries to fetch domains