Usage has changed somewhat over the years. The OED has a nice example to show that there was once nothing wrong at all with the former question. Under sense 4b at job - defined as 'A paid position of regular employment, a post, a situation; an occupation, a profession' - we see from 1919 a quotation from the Times: ' ‘What is your job?’ You are a Judge—or a Painter—or a Solicitor—or a Doctor.'
But over the years, job has come to be used more in relation to subordinate roles - employees rather than employers - and especially to people in lower-paid work. It doesn't easily apply to people who don't get routinely paid, such as self-employed artists. I can readily answer the question 'What do you do?' But, as a freelance writer, I feel uncomfortable if someone asks me 'What's your job?' I've often heard people say, in response to this question, 'I don't have a job' or 'I don't have a job as such', or the like. And I've also encountered senior professionals who turn their noses up at the question, or who only use the word in a jocular way when referrring to themselves. I remember an occasion when a senior academic, who also happened to be a competent pianist, was playing a piece at a party. Someone asked him whether he was a professional pianist. No, he said, he worked at the university. 'That's my day job', he added, in a self-demeaning tone. Very British.
'What do you do?' is the safer option, therefore, because it covers all possibilities. But, as with all personal questions, it needs to be used sensitively, as some people could find it intrusive.