I dont think the joke was racist in a hurtful way but it was inappropriate. He asked if he could call him coon, so it was a double entendre because the guy was black and his name last name was coon. Kinda hacky but minimally funny, done in a light hearted way.
Jokes like that between friends...