His behavior could have a variety of motivators from being fearful to being territorial or even just being frustrated that he can’t meet the other dog. Here are a few things to try, but we suggest contacting a professional dog trainer that can see his behavior in person and provide a customized plan. Since the behavior is relatively new, you should be able to get him back on track quickly.
First, bring extra yummy treats when you walk with him. These should be treats that he ONLY gets when he sees dogs. As soon as you see the dog, start praising him lavishly and give him a treat. This will help him learn that dog equals treat. If dog equals treat, then there is no reason to bark and lunge. Keep treating him as long as he is calm and try to create enough distance between you and the other dog so he doesn’t react. if he does react, calmly say nope, block him for a moment with your body, then turn and walk away from the other dog. This creates distance between him and the dog and should help to calm him. Try to stay as relaxed as possible when you see a dog or when he lunges. If you react when he does then you will only add stress into the situation. Also, make sure the walks have structure. If he is allowed to pull on the leash, stops to sniff every 5 feet, and pees on all of the trees, then he will think that he is walking you. This means he won’t listen to you when he sees another dog. Practice having him walk next to you on a loose leash. Have him sit multiple times on a walk just because you asked him too. You can also change your walking speed or normal route. All of these things will help him learn that you are in control on a walk. If you are in control, then he needs to listen when he sees another dog.