How to delete ip route by URL?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite












After running a (probably broken) openvpn script, I have an IP route table where one entry is a URL:



# netstat -r 
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default 10.0.0.1 0.0.0.0 UG 0 0 0 wlp58s0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp58s0
google.com 10.0.0.1 255.255.255.255 UGH 0 0 0 wlp58s0


How can I delete this last row? The regular way throws an error:



# ip route del google.com
Error: any valid prefix is expected rather than "google.com".


I'm on gentoo linux, if that matters.







share|improve this question















  • 6




    Adding the -n flag to netstat will remove any confusion.
    – Jeff Schaller
    Jul 28 at 16:58






  • 1




    Oh, so simple, thanks! If you post it as an answer, I'll accept it.
    – Felix
    Jul 28 at 17:15
















up vote
1
down vote

favorite












After running a (probably broken) openvpn script, I have an IP route table where one entry is a URL:



# netstat -r 
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default 10.0.0.1 0.0.0.0 UG 0 0 0 wlp58s0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp58s0
google.com 10.0.0.1 255.255.255.255 UGH 0 0 0 wlp58s0


How can I delete this last row? The regular way throws an error:



# ip route del google.com
Error: any valid prefix is expected rather than "google.com".


I'm on gentoo linux, if that matters.







share|improve this question















  • 6




    Adding the -n flag to netstat will remove any confusion.
    – Jeff Schaller
    Jul 28 at 16:58






  • 1




    Oh, so simple, thanks! If you post it as an answer, I'll accept it.
    – Felix
    Jul 28 at 17:15












up vote
1
down vote

favorite









up vote
1
down vote

favorite











After running a (probably broken) openvpn script, I have an IP route table where one entry is a URL:



# netstat -r 
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default 10.0.0.1 0.0.0.0 UG 0 0 0 wlp58s0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp58s0
google.com 10.0.0.1 255.255.255.255 UGH 0 0 0 wlp58s0


How can I delete this last row? The regular way throws an error:



# ip route del google.com
Error: any valid prefix is expected rather than "google.com".


I'm on gentoo linux, if that matters.







share|improve this question











After running a (probably broken) openvpn script, I have an IP route table where one entry is a URL:



# netstat -r 
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default 10.0.0.1 0.0.0.0 UG 0 0 0 wlp58s0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp58s0
google.com 10.0.0.1 255.255.255.255 UGH 0 0 0 wlp58s0


How can I delete this last row? The regular way throws an error:



# ip route del google.com
Error: any valid prefix is expected rather than "google.com".


I'm on gentoo linux, if that matters.









share|improve this question










share|improve this question




share|improve this question









asked Jul 28 at 16:41









Felix

1083




1083







  • 6




    Adding the -n flag to netstat will remove any confusion.
    – Jeff Schaller
    Jul 28 at 16:58






  • 1




    Oh, so simple, thanks! If you post it as an answer, I'll accept it.
    – Felix
    Jul 28 at 17:15












  • 6




    Adding the -n flag to netstat will remove any confusion.
    – Jeff Schaller
    Jul 28 at 16:58






  • 1




    Oh, so simple, thanks! If you post it as an answer, I'll accept it.
    – Felix
    Jul 28 at 17:15







6




6




Adding the -n flag to netstat will remove any confusion.
– Jeff Schaller
Jul 28 at 16:58




Adding the -n flag to netstat will remove any confusion.
– Jeff Schaller
Jul 28 at 16:58




1




1




Oh, so simple, thanks! If you post it as an answer, I'll accept it.
– Felix
Jul 28 at 17:15




Oh, so simple, thanks! If you post it as an answer, I'll accept it.
– Felix
Jul 28 at 17:15










1 Answer
1






active

oldest

votes

















up vote
5
down vote



accepted










The entry google.com is not a URL; it's a domain name, or possibly a host name. (It could be part of a URL, though.)



If you use netstat -rn you will get IP addresses instead of names in that first column. From there you can delete the route - again by reference to its network and subnet addressing.



netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default server.roaima 0.0.0.0 UG 0 0 0 eth1
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
google.com 0.0.0.0 255.255.255.255 UH 0 0 0 eth1

netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.2.2 0.0.0.0 UG 0 0 0 eth1
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
216.58.198.174 0.0.0.0 255.255.255.255 UH 0 0 0 eth1

route delete -host 216.58.198.174


You can also do this with the newer ip route, which lists routes only with IP addresses. Use ip route del to delete the unwanted entry.






share|improve this answer





















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f459064%2fhow-to-delete-ip-route-by-url%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    5
    down vote



    accepted










    The entry google.com is not a URL; it's a domain name, or possibly a host name. (It could be part of a URL, though.)



    If you use netstat -rn you will get IP addresses instead of names in that first column. From there you can delete the route - again by reference to its network and subnet addressing.



    netstat -r
    Kernel IP routing table
    Destination Gateway Genmask Flags MSS Window irtt Iface
    default server.roaima 0.0.0.0 UG 0 0 0 eth1
    192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    google.com 0.0.0.0 255.255.255.255 UH 0 0 0 eth1

    netstat -rn
    Kernel IP routing table
    Destination Gateway Genmask Flags MSS Window irtt Iface
    0.0.0.0 192.168.2.2 0.0.0.0 UG 0 0 0 eth1
    192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    216.58.198.174 0.0.0.0 255.255.255.255 UH 0 0 0 eth1

    route delete -host 216.58.198.174


    You can also do this with the newer ip route, which lists routes only with IP addresses. Use ip route del to delete the unwanted entry.






    share|improve this answer

























      up vote
      5
      down vote



      accepted










      The entry google.com is not a URL; it's a domain name, or possibly a host name. (It could be part of a URL, though.)



      If you use netstat -rn you will get IP addresses instead of names in that first column. From there you can delete the route - again by reference to its network and subnet addressing.



      netstat -r
      Kernel IP routing table
      Destination Gateway Genmask Flags MSS Window irtt Iface
      default server.roaima 0.0.0.0 UG 0 0 0 eth1
      192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
      google.com 0.0.0.0 255.255.255.255 UH 0 0 0 eth1

      netstat -rn
      Kernel IP routing table
      Destination Gateway Genmask Flags MSS Window irtt Iface
      0.0.0.0 192.168.2.2 0.0.0.0 UG 0 0 0 eth1
      192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
      216.58.198.174 0.0.0.0 255.255.255.255 UH 0 0 0 eth1

      route delete -host 216.58.198.174


      You can also do this with the newer ip route, which lists routes only with IP addresses. Use ip route del to delete the unwanted entry.






      share|improve this answer























        up vote
        5
        down vote



        accepted







        up vote
        5
        down vote



        accepted






        The entry google.com is not a URL; it's a domain name, or possibly a host name. (It could be part of a URL, though.)



        If you use netstat -rn you will get IP addresses instead of names in that first column. From there you can delete the route - again by reference to its network and subnet addressing.



        netstat -r
        Kernel IP routing table
        Destination Gateway Genmask Flags MSS Window irtt Iface
        default server.roaima 0.0.0.0 UG 0 0 0 eth1
        192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
        google.com 0.0.0.0 255.255.255.255 UH 0 0 0 eth1

        netstat -rn
        Kernel IP routing table
        Destination Gateway Genmask Flags MSS Window irtt Iface
        0.0.0.0 192.168.2.2 0.0.0.0 UG 0 0 0 eth1
        192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
        216.58.198.174 0.0.0.0 255.255.255.255 UH 0 0 0 eth1

        route delete -host 216.58.198.174


        You can also do this with the newer ip route, which lists routes only with IP addresses. Use ip route del to delete the unwanted entry.






        share|improve this answer













        The entry google.com is not a URL; it's a domain name, or possibly a host name. (It could be part of a URL, though.)



        If you use netstat -rn you will get IP addresses instead of names in that first column. From there you can delete the route - again by reference to its network and subnet addressing.



        netstat -r
        Kernel IP routing table
        Destination Gateway Genmask Flags MSS Window irtt Iface
        default server.roaima 0.0.0.0 UG 0 0 0 eth1
        192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
        google.com 0.0.0.0 255.255.255.255 UH 0 0 0 eth1

        netstat -rn
        Kernel IP routing table
        Destination Gateway Genmask Flags MSS Window irtt Iface
        0.0.0.0 192.168.2.2 0.0.0.0 UG 0 0 0 eth1
        192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
        216.58.198.174 0.0.0.0 255.255.255.255 UH 0 0 0 eth1

        route delete -host 216.58.198.174


        You can also do this with the newer ip route, which lists routes only with IP addresses. Use ip route del to delete the unwanted entry.







        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered Jul 28 at 17:19









        roaima

        39.2k544105




        39.2k544105






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f459064%2fhow-to-delete-ip-route-by-url%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?