How does character controller's isGrounded() detect whether the character's on the ground?

I was initially hoping that character controller's isGrounded() operated purely on whether or not the bottom of the controller was colliding with anything, but I've got a rotatable character controller that, for example, can run on walls, and if I'm running up a horizontal surface I no longer get a true result for isGrounded().

Is there something else I can edit on character controller to change the behavior of isGrounded(), for example setting what relative vector to look for the ground on?

I can go and look at the colliders myself, I'm just seeing if there's a way to do this using isGrounded().

As far as i know isGrounded is just a wrapper for

if((controller.collisionFlags & CollisionFlags.Below) != 0)

You can check the collision bit flag if he collides above or at the sides.

CollisionFlags.Sides don't tell you what side you collided. You could use CharacterController.OnControllerColliderHit to get detailed information about all collisions of your charactercontroller.

The ControllerColliderHit structure gives you everything, the exact hit point, the object you collided with and the surface normal.