Index: src/wp-admin/admin-ajax.php
===================================================================
--- src/wp-admin/admin-ajax.php	(revision 37314)
+++ src/wp-admin/admin-ajax.php	(working copy)
@@ -62,7 +62,7 @@
 	'send-attachment-to-editor', 'save-attachment-order', 'heartbeat', 'get-revision-diffs',
 	'save-user-color-scheme', 'update-widget', 'query-themes', 'parse-embed', 'set-attachment-thumbnail',
 	'parse-media-shortcode', 'destroy-sessions', 'install-plugin', 'update-plugin', 'press-this-save-post',
-	'press-this-add-category', 'crop-image', 'generate-password', 'save-wporg-username',
+	'press-this-add-category', 'crop-image', 'generate-password', 'save-wporg-username', 'url-exists',
 );
 
 // Deprecated
Index: src/wp-admin/includes/ajax-actions.php
===================================================================
--- src/wp-admin/includes/ajax-actions.php	(revision 37314)
+++ src/wp-admin/includes/ajax-actions.php	(working copy)
@@ -3327,3 +3327,22 @@
 
 	wp_send_json_success( update_user_meta( get_current_user_id(), 'wporg_favorites', $username ) );
 }
+
+/**
+ * Ajax handler for checking the existence of a URL.
+ *
+ * @since 4.6.0
+ */
+function wp_ajax_url_exists() {
+
+
+	$array = get_headers( $_POST['check_url'] );
+	$string = $array[0];
+
+	if( '' != $string && ! preg_match( '/4[0-9][0-9]/', $string ) ) {
+		wp_send_json_success('success');
+	} else {
+		wp_send_json_error('failed');
+	}
+
+}
Index: src/wp-includes/css/editor.css
===================================================================
--- src/wp-includes/css/editor.css	(revision 37314)
+++ src/wp-includes/css/editor.css	(working copy)
@@ -1775,6 +1775,15 @@
 	margin: 2px 1px;
 }
 
+div.wp-link-bad {
+	display: none;
+    cursor: default;
+    margin: 5px;
+    float: right;
+    font-weight: 600;
+    color: #a00;
+}
+
 .mce-inline-toolbar-grp .mce-btn-group .mce-btn:last-child {
 	margin-right: 2px;
 }
Index: src/wp-includes/js/tinymce/plugins/wplink/plugin.js
===================================================================
--- src/wp-includes/js/tinymce/plugins/wplink/plugin.js	(revision 37314)
+++ src/wp-includes/js/tinymce/plugins/wplink/plugin.js	(working copy)
@@ -84,6 +84,15 @@
 		}
 	} );
 
+	tinymce.ui.WPBadLink = tinymce.ui.Control.extend( {
+		renderHtml: function() {
+			return (
+				'<div id="' + this._id + '" class="wp-link-bad" title="This URL does not lead to a working page.">Bad Link</div>'
+			);
+		},
+	} );
+
+
 	tinymce.PluginManager.add( 'wplink', function( editor ) {
 		var toolbar;
 		var editToolbar;
@@ -133,6 +142,7 @@
 		function removePlaceholderStrings( content, dataAttr ) {
 			if ( dataAttr ) {
 				content = content.replace( / data-wplink-edit="true"/g, '' );
+				content = content.replace( / data-link-broken="true"/g, '' );
 			}
 
 			return content.replace( /<a [^>]*?href="_wp_link_placeholder"[^>]*>([\s\S]+)<\/a>/g, '$1' );
@@ -143,7 +153,8 @@
 				toolbar = editor.wp._createToolbar( [
 					'wp_link_preview',
 					'wp_link_edit',
-					'wp_link_remove'
+					'wp_link_remove',
+					'wp_link_bad',
 				], true );
 
 				var editButtons = [
@@ -226,6 +237,45 @@
 					href = 'http://' + href;
 				}
 
+				try {
+					xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
+				} catch ( e1 ) {
+					try {
+						xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+					} catch ( e2 ) {
+						xmlhttp = false;
+					}
+				}
+
+				if ( ! xmlhttp ) {
+					if ( 'undefined' != typeof XMLHttpRequest ) {
+						xmlhttp = new XMLHttpRequest();
+					} else if ( window.createRequest ) {
+						xmlhttp = window.createRequest();
+					} else {
+						xmlhttp = false;
+					}
+				}
+
+				if( false != xmlhttp ) {
+					var data = {
+						type: 'POST',
+						check_url: href,
+					}
+
+					wp.ajax.send( 'url-exists', {
+						data: data,
+						success: function () {
+							linkNode.removeAttribute( 'data-link-broken' );
+							badLinkFlag.css('display', 'none');
+						},
+						error: function() {
+							linkNode.setAttribute( 'data-link-broken', true );
+							badLinkFlag.css('display', 'block');
+						},
+					});
+				}
+
 				editor.dom.setAttribs( linkNode, { href: href, 'data-wplink-edit': null } );
 
 				if ( ! tinymce.trim( linkNode.innerHTML ) ) {
@@ -483,6 +533,13 @@
 			editToolbar.tempHide = false;
 
 			if ( linkNode ) {
+
+				if( linkNode.hasAttribute('data-link-broken') ) {
+					badLinkFlag.css('display', 'block');
+				} else {
+					badLinkFlag.css('display', 'none');
+				}
+
 				$linkNode = editor.$( linkNode );
 				href = $linkNode.attr( 'href' );
 				edit = $linkNode.attr( 'data-wplink-edit' );
@@ -551,6 +608,13 @@
 			classes: 'widget btn primary'
 		} );
 
+		editor.addButton( 'wp_link_bad', {
+			type: 'WPBadLink',
+			onPostRender: function() {
+				badLinkFlag = $('#'+this._id);
+			}
+		} );
+
 		return {
 			close: function() {
 				editToolbar.tempHide = false;
@@ -558,4 +622,4 @@
 			}
 		};
 	} );
-} )( window.tinymce );
+} )( window.tinymce );
\ No newline at end of file
Index: src/wp-includes/js/tinymce/skins/wordpress/wp-content.css
===================================================================
--- src/wp-includes/js/tinymce/skins/wordpress/wp-content.css	(revision 37314)
+++ src/wp-includes/js/tinymce/skins/wordpress/wp-content.css	(working copy)
@@ -501,6 +501,11 @@
 	float: right;
 }
 
+/* For bad links in the text editor */
+a[data-link-broken="true"] {
+	color: #a00;
+}
+
 @media print,
 	(-o-min-device-pixel-ratio: 5/4),
 	(-webkit-min-device-pixel-ratio: 1.25),
