Today, ifconfig was not working for me. I think this happened after I installed X11 on my headless server.
bash: ifconfig: command not found
It turns out something removed /sbin from my $PATH. Read more about the $PATH here.
The ifconfig-command resides in /sbin:
$ whereis ifconfig
The solution is to put something like this in your .bashrc: