THE GAME HAS CHANGED

Introducing Infoblox Universal DDI ManagementTM

Watch the launch to discover the new era of management for critical network services. Watch Now

API & Integration, DevOps,NetOps,SecOps

Reply

Returning a list of Aliases using the record:alias API request

New Member
Posts: 2
9350     0

Hi Experts, 

Could anyone out there advise how I can use the record:alias API request to obtain a list of host aliases? The Infoblox grid viewer allows you to request a list of all Aliases by use of a filter of: Type = Host Alias. I need to replicate this via an API request. On the face of it a 'request:alias' seems to be what I want, but when I try this I get no data back at all. I've tried adding adding a search criteria e.g. zone=abc.co.nz but still no joy. 

I realise that I can get a list of Aliases via a 'request:host'  and specifing alias as an extra returned field in the request, but given that I also want additional alias fields eg comments etc. this seems a long way around. 

I can get the hosts, cname, a records API requests to return me the results I need, I just can't seem to fathom how the alias API request is meant to work, or am I missing something?

Any assitance or an example woud be greatly appreciated.

Re: Returning a list of Aliases using the record:alias API request

Adviser
Posts: 11
9351     0

First let's clarify the difference between a CNAME record (colloquially known as a DNS alias), a Host record that has Aliases attached to it, and an ALIAS record.

 

The CNAME record is the most straightforward; a standard DNS record type associated with the "record:cname" object type in WAPI.

 

In the GUI for a Host record, there is an "Aliases" tab. This is an Infoblox specific convenience feature that ultimately creates CNAME records under the hood, but keeps them associated with the parent Host record so you don't have to maintain them separately. There is no individual "record:blah" object type for these. They only exist as a field on the "record:host" object.

 

The ALIAS record is a relatively new *virtual* record type to address the DNS spec limitation that CNAMEs can't be associated with apex domains. This is what the "record:alias" is referencing. See also here: https://docs.infoblox.com/display/nios85/Managing+Resource+Records#ManagingResourceRecords-bookmark1...

 

Based on your question, I'm guessing your queries that reference "record:alias" are not finding anything because you haven't actually created any ALIAS records. What it sounds like you have are the aliases associated with host objects. But unfortunately, there's no way to query *just* those because the "aliases" attribute on "record:host" doesn't allow for any filter criteria. So your only solution is to search for all host objects and filter them client side.

 

The other option is to convert all of those host aliases to individual CNAME records which are then queryable directly. But you lose the convenience of having them directly associated with your hosts.

Re: Returning a list of Aliases using the record:alias API request

New Member
Posts: 2
9351     0

Hi,

Thankyou so much you have clarified the situation perfectly. 

And, yes I was hoping to be able to able to use the record:alias to pull a list of aliases for hosts. As you have pointed out this doesn't work like this. In the mean time I did exactly what you sugested and pulled the aliases as part of the host processing and extracted them 'client' side. Nice to know that my solution aligned with your suggestion and I haven't wasted my time. 

 

I am most grateful for you taking the time the to explain. For someone who doesn't have an in depth knowledge of all things DNS and just needs to extract the infomation this has helped me a lot!

 

Best Regards 

Re: Returning a list of Aliases using the record:alias API request

Techie
Posts: 9
9351     0

HIKiwipete

 good to see this post im alos looking for the same. but im not getting the result of aliases and cname associate to a host

im checking with host:record name~

 lookup('nios', 'record:host', filter={'name~': '

can you pls post your steps how you achieved it.

Re: Returning a list of Aliases using the record:alias API request

Adviser
Posts: 11
9351     0

I don't recognize the lookup function you posted. But generally, you need to request the specific return fields you want to see in the response. When you're doing a raw REST call, it would be using a querystring argument like "_return_fields=aliases". So perhaps your lookup function as an optional argument for return fields?

Re: Returning a list of Aliases using the record:alias API request

New Member
Posts: 1
9351     0

We are a recent convert to Infoblox and at the time of the conversion I had reservations about the proprietary "Host" record type at the time. At this point I'm really leaning towards not using them or at least not using Host Aliases. We are currently using the Infoblox plugin for vRO and it is creating "host" records during automation which has prompted an influx of Host Aliases that are not visialble when using the WAPI. The inability to search by "aliases" on "record:host" is a real problem. I'd be real intested in understand why the "aliases" list cannot be searched using aliases~? I can certainly pull down all host records and search client side but that is so inefficient. I'm starting to seriously consider changing all host aliases to true CNAMES since with automation the benefits of the Host Record are negligible. Anyone else having similiar experiences? 

Re: Returning a list of Aliases using the record:alias API request

Adviser
Posts: 11
9351     0

I still like Host records for addresses that I'm also hosting a reverse zone for because not having to separately manage A and PTR is nice and it's more intuitive to non-DNS folks when IPs change. However, I steer clear of adding Aliases to Host records for precisely the reasons you mentioned. WAPI not allowing filtering on that field seems like a huge oversight.

 

So yeah, CNAMEs remain as individual record:cname objects instead of Host aliases in my environments.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You