I am playing multiplayer EDH and I want to exile my library using Demonic Consultation. To name a valid card, does it have to be legal in the format or can I name any card that exists in MTG?
As of the rules update for GRN, you are permitted to name card names that are not legal in the format you're playing. Even before GRN, you could name a card not legal in your Commander deck (so long as it was legal in Commander generally).
I̟̥͍̠ͅn̩͉̣͍̬͚ͅ ̬̬͖t̯̹̞̺͖͓̯̤h̘͍̬e͙̯͈̖̼̮ ̭̬f̺̲̲̪i͙͉̟̩̰r̪̝͚͈̝̥͍̝̲s̼̻͇̘̳͔ͅt̲̺̳̗̜̪̙ ̳̺̥̻͚̗ͅm̜̜̟̰͈͓͎͇o̝̖̮̝͇m̯̻̞̼̫̗͓̤e̩̯̬̮̩n͎̱̪̲̹͖t͇̖s̰̮ͅ,̤̲͙̻̭̻̯̹̰ ̖t̫̙̺̯͖͚̯ͅh͙̯̦̳̗̰̟e͖̪͉̼̯ ̪͕g̞̣͔a̗̦t̬̬͓͙̫̖̭̻e̩̻̯ ̜̖̦̖̤̭͙̬t̞̹̥̪͎͉ͅo͕͚͍͇̲͇͓̺ ̭̬͙͈̣̻t͈͍͙͓̫̖͙̩h̪̬̖̙e̗͈ ̗̬̟̞̺̤͉̯ͅa̦̯͚̙̜̮f͉͙̲̣̞̼t̪̤̞̣͚e̲͉̳̥r͇̪̙͚͓l̥̞̞͎̹̯̹ͅi͓̬f̮̥̬̞͈ͅe͎ ̟̩̤̳̠̯̩̯o̮̘̲p̟͚̣̞͉͓e͍̩̣n͔̼͕͚̜e̬̱d̼̘͎̖̹͍̮̠,͖̺̭̱̮ ̣̲͖̬̪̭̥a̪͚n̟̲̝̤̤̞̗d̘̱̗͇̮͕̳͕͔ ͖̞͉͎t̹̙͎h̰̱͉̗e̪̞̱̝̹̩ͅ ̠̱̩̭̦p̯̙e͓o̳͚̰̯̺̱̰͔̘p̬͎̱̣̼̩͇l̗̟̖͚̠e̱͉͔̱̦̬̟̙ ̖͚̪͔̼̦w̺̖̤̱e͖̗̻̦͓̖̘̜r̭̥e͔̹̫̱͕̦̰͕ ̗͔̠p̠̗͍͍̱̳̠r̰͔͎̰o͉̥͓̰͚̥s̟͚̹̱͔̣t͉̙̳̖͖̪̮r̥̘̥͙̹a͉̟̫̟̳̠̟̭t͈̜̰͈͎e̞̣̭̲̬ ͚̗̯̟͙i͍͖̰̘̦͖͉ṇ̮̻̯̦̲̩͍ ̦̮͚̫̤t͉͖̫͕ͅͅh͙̮̻̘̣̮̼e͕̺ ͙l͕̠͎̰̥i̲͓͉̲g̫̳̟͈͇̖h̠̦̖t͓̯͎̗ ̳̪̘̟̙̩̦o̫̲f̙͔̰̙̠ ̹̪̗͇̯t͖̼̼͉͖̬h̹͇̩e͚̖̺̤͉̹͕̪ ͚͓̭̝̺G͎̗̯̩o̫̯̮̟̮̳̘d̜̲͙̠-̩̳̯̲̗̜P̹̘̥͉̝h͍͈̗̖̝ͅa͍̗̮̼̗r̜̖͇̙̺a̭̺͔̞̳͈o̪̣͓̯̬͙̯̰̗h̖̦͈̥̯͔.͇̣̙̝
Two Score, Minus Two or: A Stargate Tail
(Image by totallynotabrony)