The line console 0 command allows you to configure the console port
The line vty 0 4 command allows you to configure Virtual Ports 0 thru 4 – (vty ports are accessed throgh the port connections)
Notice that the prompt changes to reflect the level you are in, in this case from R1 (config)# to R1 (config-line)#
At this point the password command is setting a password for basic access to the device
The no prefix always reverses the command
Here we are turning off DNS Services