How to disable ipv6 adrress resolve in DNS - linux

I want to disable ipv6 resolve.
When I do nslookup for host name it is giving 2 ip addresses i want to disable ipv6 address permanently. I'm using im6q sabrelite board yocto build.
Linux version is 3.14
nslookup c1457415477.mgr.gcsp.cddbp.net
Server: 172.16.1.90
Address 1: 172.16.1.90 hobbes.local
Name: c1457415477.mgr.gcsp.cddbp.net
Address 1: 209.10.41.84 service.gracenote.com
Address 2: 64:ff9b::602e:9622
Thank you for your time.

The IPv6 answer you see is from a DNS64 resolver. That would indicate that IPv6 is important on that network (and that the network might go IPv6-only) and you're better off not disabling it.
That aside, if you really want to filter out IPv6 results I think the only option you have is to run your own DNS resolver where you filter out all AAAA records. This is not easy and will likely break things. See https://serverfault.com/questions/554085/can-i-configure-a-dns-cache-not-to-forward-aaaa-queries for more information.

Related

How do I configure DNS in ubuntu? Why is it displayed that the domain name resolution has failed temporarily?

I guess it's because my virtual machine is not connected to the Internet correctly, but I don't understand how to configure DNS? I tried a lot, but I don’t quite understand it. It’s the first time to learn computer, hoping to help me, thank you 🙏
The examples below use Cloudflare (1.1.1.1) and Google (8.8.8.8) DNS Servers. You might want to consider using a local DNS forwarder, or different, more privacy friendly public DNS servers, instead.
If using Ubuntu Server:
As per the documentation (https://ubuntu.com/server/docs/network-configuration), the resolver configuration file (/etc/resolv.conf), is dynamically generated by Netplan.
You can temporarily add nameserver entries to /etc/resolv.conf, for example:
nameserver 1.1.1.1
nameserver 8.8.8.8
However, those will be overwritten by Netplan. If the changes worked, make them permanent by looking for the Netplan configuration file, usually a .yaml in /etc/netplan. Add a nameserver block, or modify the existing one:
nameservers:
addresses: [1.1.1.1, 8.8.8.8]
If using Ubuntu Desktop:
Assuming NetworkManager is installed:
Look for the connection name:
nmcli con
Add your DNS servers:
nmcli con mod <connectionName> ipv4.dns "1.1.1.1 8.8.8.8"
In the future, please consider using the https://askubuntu.com/ forums for these questions instead.

logstash http-poller input force ipv6 usage?

I would like to force the http_poller to use ipv6 first prior to ipv4.
The host running logstash is dual stacked and the target host also.
The issue lies in the ACL on the target host only accepting requests from the IPv6 addresses on the vhost configured.
curl works as it is default ipv6 first if dual stacked and ipv6 addresses are returned by dns (but also ipv4).
When in touch with the supplier of the endpoint it seemed that we are going over ipv4 when using the http_poller input from logstash iso ipv6, I see no options in the plugin to force ipv6 and the supplier is not going to change its dns, nor allowing our ipv4 address.
I know that I could create a workaround with having an exec input that handles the request, but I consider this only as a last resort.
Someone who has an idea on how to solve it?
Update: I already looked into the info of manticore http client, but did not find a solution there (thanks Badger for reminding me to share the fact that I already looked into this)

Dynamic DNS for IPv6 results in IP address could not be found

I am trying to switch my dynamic DNS from IPv4 to IPv6, but I am encountering a strange issue. The device is accessible via its raw IPv6 address, but whatever dynamic DNS server I use, it always results in an IP address not found issue. The IPv4 one works fine though. The server is also correctly configured, otherwise the raw address would not work.
What is even stranger is that services like http://ipv6-test.com seem to be able to verify that IPv6 functionality exists and also which web server I use. They also list the corresponding name servers.
I tried the dynamic DNS services of spdyn, dynv6, and ddnss. I also tried noip, but it seems they only support IPv4 for free. (My IPv4 one is with noip.)
Does anybody have some advice? I'm thankful for any help!
Most probably your network is not supporting IPv6.

Alternative to glibc Library call res_ninit for getting DNS details over DHCP

Is there a good API alternative to res_ninit?
There are problems with this call because the res->_u.ext.nscount6 and res->nscount do not reflect correct numbers. Adding a IPv6 address to /etc/resolv.conf still results in the nscount increasing where you would have expected the nscount6 to increase.
An older glibc version seems to increase both nscount and nscount6 for a IPv6 address in /etc/resolv.conf.
I am currently parsing resolv.conf directly because i am unable to depend on the res_ninit call. But this is fine for Manual DNS.
When it comes to DHCP DNS, then i need an API to give me the result. There is no other way (that i can think of) to determine the DNS IP addresses over DHCP.
Tried posting in other places within the board but not of help so far. E.g.
Retrieve IPv4 and IPv6 nameservers programmatically
res_ninit and res_init only ever read name server information from /etc/resolv.conf. You can always get the same data name servers by parsing /etc/resolv.conf yourself and examining the nameserver lines. If there is no nameserver line, the default 127.0.0.1 will be used.
I don't think it is necessary to provide an API for that because the file format is so simple that is likely more difficult to use the API than to read the file instead.
Name server assignment over DHCP is implemented by rewriting /etc/resolv.conf if there is no local caching resolver running on the machine. The exact mechanism used for that is distribution-specific, e.g. Debian uses resolvconf if it is installed.
If a local caching resolver is running on the system (such as dnsmasq or Unbound), name servers over DHCP can be directly configured in that caching resolver. In this case, /etc/resolv.conf will keep pointing to the same name server, typically by listing nameserver 127.0.0.1 or no name server information at all (which is the default).

DHCP Server Port-Based Address Allocation switch cisco 2960

In my work they asked me to configure a switch cisco 2960 and to the switch we will connect printers, they want that the switch gives the ip to the printers with DHCP (we dont have a dhcp server) and they also want that in each individual port an ip would be assigned, doesnt matter if they change the printer they want the same ip address assign this is in case a printer fails and they want only to replace it and dont have to do anything about configurations. I have configured DHCP Server Port-Based Address Allocation but it isnt working
I used this guide http://www.cisco.com/en/US/docs/ios-xml/ios/ipaddr_dhcp/configuration/xe-3se/5700/dhcp-prt-bsd-aa.pdf
but it isnt assigning anything.
Tough to give a good answer without seeing your config. I'm going to assume you've checked you're running a version of code that supports this and that you've checked for typos.
Given that, I can only see one thing. In the doc you've linked to, it shows the syntax for the assignment being:
ip dhcp pool dhcppool
network 10.1.1.0 255.255.255.0
address 10.1.1.7 client-id Et1/0 ascii
In this document which is specifically for the 2960, it shows quotes round the Et1/0. So you have:
ip dhcp pool dhcppool
network 10.1.1.0 255.255.255.0
address 10.1.1.7 client-id "Et1/0" ascii
Beyond that, is it bulking at a certain point or is it taking all the commands?
I don't have a 2960 here to test it, so this is the best I can do.
Hope this helps.

Resources