AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / ubuntu / Perguntas / 1481310
Accepted
Luis Abreu
Luis Abreu
Asked: 2023-08-06 23:55:09 +0800 CST2023-08-06 23:55:09 +0800 CST 2023-08-06 23:55:09 +0800 CST

Ipv6 vs Ipv4: existe uma maneira de forçar o uso do ipv6?

  • 772

Ubuntu/Linux iniciante aqui, então eu queria saber se há alguma maneira de forçar o Ubuntu a preferir IPv4 ou IPv6 ao resolver um nome (ex.: google.com tem endereços ipv4 e ipv6. existe alguma configuração que me permita dizer que IPv6 deve ser preferido sobre o IPv4 quando algum aplicativo solicita esse nome?)

Obrigado.

dns
  • 1 1 respostas
  • 33 Views

1 respostas

  • Voted
  1. Best Answer
    Terrance
    2023-08-07T00:14:58+08:002023-08-07T00:14:58+08:00

    Você seria capaz de alterá-lo no /etc/gai.confarquivo.

    De man gai.conf:

    DESCRIPTION
           A  call  to getaddrinfo(3) might return multiple answers.  According to
           RFC 3484 these answers must be sorted so that the answer with the high‐
           est  success  rate is first in the list.  The RFC provides an algorithm
           for the sorting.  The static rules are  not  always  adequate,  though.
           For  this  reason,  the  RFC  also  requires that system administrators
           should have the possibility to dynamically change the sorting.  For the
           glibc implementation, this can be achieved with the /etc/gai.conf file.
    
           Each  line  in the configuration file consists of a keyword and its pa‐
           rameters.  White spaces in any place are ignored.  Lines starting  with
           '#' are comments and are ignored.
    

    Há uma seção nesse arquivo de linhas comentadas que você pode alterar. Há uma linha em particular que afirma o seguinte:

    #    For sites which prefer IPv4 connections change the last line to
    #
    #precedence ::ffff:0:0/96  100
    

    O que deve significar que, se você deseja que o IPv4 seja preferido em relação ao IPv6, basicamente teria que descomentar as linhas acima e alterar a última linha para o que o comentário está afirmando.

    • 0

relate perguntas

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Existe um comando para listar todos os usuários? Também para adicionar, excluir, modificar usuários, no terminal?

    • 9 respostas
  • Marko Smith

    Como excluir um diretório não vazio no Terminal?

    • 4 respostas
  • Marko Smith

    Como descompactar um arquivo zip do Terminal?

    • 9 respostas
  • Marko Smith

    Como instalo um arquivo .deb por meio da linha de comando?

    • 11 respostas
  • Marko Smith

    Como instalo um arquivo .tar.gz (ou .tar.bz2)?

    • 14 respostas
  • Marko Smith

    Como listar todos os pacotes instalados

    • 24 respostas
  • Martin Hope
    Flimm Como posso usar o docker sem sudo? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    led-Zepp Como faço para salvar a saída do terminal em um arquivo? 2014-02-15 11:49:07 +0800 CST
  • Martin Hope
    ubuntu-nerd Como descompactar um arquivo zip do Terminal? 2011-12-11 20:37:54 +0800 CST
  • Martin Hope
    TheXed Como instalo um arquivo .deb por meio da linha de comando? 2011-05-07 09:40:28 +0800 CST
  • Martin Hope
    Ivan Como listar todos os pacotes instalados 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    David Barry Como determino o tamanho total de um diretório (pasta) na linha de comando? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher "Os seguintes pacotes foram retidos:" Por que e como resolvo isso? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford Como os PPAs podem ser removidos? 2010-07-30 01:09:42 +0800 CST

Hot tag

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve