No, you have to check yourself whether the input is correct for your program.
Note that this makes sense, since you may want to check if the input is correct at the same time. In your example you should check if the input exists AND if the input is a valid ip-address.