Direct contact membrane distillation is a promising unit operation for treating hydraulic fracturing flow back and produced water. However, while a hydrophobic membrane is essential to prevent the passage of water from the feed to the permeate side, fouling by dissolved organic species can compromise membrane performance and result in wetting of the membrane pores. Here four monomers, hydroxyethylmethacrylate, acrylic acid, 1-vinyl-3-allylimidazolium bromide, and 1-vinyl-3-hexylimidazolium bromide have been grafted from the surface of a PVDF membrane. The modified and base membranes were tested in a direct contact membrane distillation system. All membranes were challenged with real produced water. In addition, base membranes and membranes modified by grafting 1-vinyl-3-allylimidazolium bromide were challenged with produced water that was pretreated by electrocoagulation. These membranes were also challenged with a synthetic wastewater made by adding to DI water the major inorganic compounds present in the produced water. The highest fluxes were obtained for the membrane grafted with 1-vinyl-3-allylimidazolium bromide chains. The membrane surface after membrane distillation was analyzed by scanning electron microscopy and energy-dispersive X-ray (EDX) spectroscopy. For all membranes, the interaction between adsorbed organic and inorganic species determines the degree of fouling and hence the loss in flux and membrane stability. Polyionic liquid chains that contain a repeating charged species and hydrophobic segments minimized fouling by organic species and improved the flux and membrane stability. The results suggest that by carefully tuning the properties of the monomer units in the polymer chains, membrane stability and performance can be improved