Yes, It is rude. The person asking is trying to get confirmation on whether the person is really from the place they say based on their physical appearance and/or name. But, context matters and it depends on the person being asked on whether to be offended or not.
One of my best friend's heritage is Gambian, but he himself is from London. We've had a conversation about this exact same scenario. People who were natively from the UK would ask the exact same thing. He has always preferred it when someones asked where his parents were from to get information on cultural heritage, rather than the assumption he wasn't originally from the UK. He's a first generation immigrant, so this isn't the case for everyone. He would justnormally see it as someone being ignorant and the other person being naive or "that's/"that's the way they've been brought up" rather than being outright rude.
To me, a good alternative would be to not ask at all. Ethnicity shouldn't be really on the cards in a natural conversation if they're only curious about where the person they're asking is from. It should be believed that they're from where they say. The best way would be for the person to volunteer their ethnicity organically rather than be asked.
But, if you are curious about their ethnicity, it should be asked at an appropriate time and place. Written at the bottom of How to Ask Someone About Their Ethnicity Without Being an Asshole
Being curious about someone's ethnicity is perfectly fine, but just be aware that how and when you ask it has an impact on people, and if you're an asshole about it, the impact is othering. I've never been curt enough to say it when people ask me about my ethnicity, but the question that always pops up in my mind is, "Why? Why do you need to know at this particular time?" Ask yourself why you're doing it before you question someone about their background. If their ethnicity is relevant to the conversation, or perhaps you're at a point in your friendship where the question is appropriate, then it's fine. But chances are, if you're asking just to ask, you really just shouldn't.
In the words of Dodai, "Keep yourself in check and don't be a jerk." It's that simple.