Eric Holder served as attorney general under President Obama from 2009 to 2015. (Saul Loebsaul/AFP/Getty Images)

Former U.S. attorney general Eric Holder has been hired by Airbnb to help craft an anti-discrimination policy for the home-sharing company, which has come under fire in recent months after complaints of racial bias by its hosts.

Airbnb, which allows homeowners to rent out rooms to guests online, has emerged as one of the largest home-sharing sites since its founding in San Francisco in 2008. It now has more than 2 million listings in 34,000 cities.

But recently, the company has faced a flurry of complaints related to racism. A Harvard Business School study last year found widespread discrimination by homeowners against those with names that sounded distinctly black. And minority users who say their travel plans have been denied or canceled because of their race have rallied under the hashtag #AirbnbWhileBlack, appealing to the company to rein in a practice that was long ago outlawed among traditional hotels.

Last month, Airbnb removed a host from the platform after he sent racial epithets to a 28-year-old Nigerian woman who was trying to reserve a home in North Carolina. The episode — and its graphic language — renewed national attention on whether the company was doing enough to root out racist users. A number of lawsuits have followed.

“While we have a policy that prohibits discrimination, we want this policy to be stronger,” chief executive Brian Chesky wrote in a blog post announcing Holder’s appointment on Wednesday. “In early June we announced that we would review every aspect of the Airbnb platform to help ensure we are doing everything we can to fight bias and discrimination.”

Chesky said the company is now halfway through that internal review, led by Laura Murphy, the former head of the American Civil Liberties Union’s legislative office in Washington.

Last week, three U.S. senators, including Elizabeth Warren (D-Mass.), wrote a letter urging the government to investigate Airbnb and other short-term rental sites for creating housing shortages and driving up rental costs.

“We have also read troubling reports of racial discrimination on some short-term rental platforms,” the senators wrote in the letter, which was also signed by Brian Schatz (D-Hawaii) and Dianne Feinstein (D-Calif.).

In his new role, Holder will work alongside John Relman, a civil rights lawyer who specializes in fair housing issues, to craft the company’s anti-discrimination policy. Relman is managing partner of District-based law firm Relman, Dane & Colfax.

Holder served as attorney general under President Obama from 2009 to 2015. Last year, he returned to the Washington law firm Covington & Burling, where he was a partner from 2001 to 2009.

 Emily Badger contributed to this report.