If a character casts Counterspell against Detect Magic as it is being cast, will the caster of Detect Magic know this, or will they think there is no magic present for the duration of the spell? Does the caster of Detect Magic know it's been counterspelled?
RAW I assume the answer is no, but if Detect Magic is already cast and active, does Counterspell have any effect?
1. Detect magic should detect yourself.
Detect magic says:
For the duration, you sense the presence of magic within 30 feet of you. If you sense magic in this way, you can use your action to see a faint aura around any visible creature or object in the area that bears magic, and you learn its school of magic, if any.
Since you are concentrating on detect magic and it is actively affecting you, you should be picking up your own magical aura. If you aren’t, you know something went wrong. I suppose you don’t explicitly know it was counter spelled, but you would know your spell did not complete casting.
2. Counterspell does nothing to spells that have already been cast.
Counterspell has a casting time of 1 reaction, “which you take when you see a creature within 60 feet of you casting a spell”. It only works on a spell in the process of being cast.