I did a quick search, and it looks like ibuprofen isn't dialyzed out very quickly - something like 15% over a standard session. That said, I don't think ibuprofen would be that effective against that kind of headache. I'm not a biochemist and I'm kinda talking out of my
, so don't take what I say as the truth, but ibuprofen targets only a certain kind of pain reaction associated with actual injury and inflammation. It seems to work for tension headaches, but it never worked for my high blood pressure headaches, and I doubt it'd work for whatever mechanism is causing your headaches - electrolyte fluctuations, sudden fluid or blood pressure changes, or whatever.
I think your doctor might just be guessing about what could treat your headache (but don't blame him - I don't think anyone really knows what causes headaches on dialysis), so if you can't get relief with what he prescribed in a reasonable amount of time, see if you can get him to try something else. What codeine-like drugs have you tried? I've found that I get sick on codeine and hydrocodone (Vicodin - not sure what the name brand is over there), but I'm fine on propoxyphene (Darvocet) and oxycodone (Percocet) - all in combination with paracetamol. It might be worth it to try out different things, but it sounds like that might be hard with your doctor(s).