fix(seautils): query ANY instead of A records
This commit is contained in:
parent
5ffc42480a
commit
29bb64b35c
1 changed files with 2 additions and 5 deletions
|
@ -88,15 +88,12 @@ class SeaUtils(commands.Cog):
|
||||||
|
|
||||||
@commands.command(name='dig', aliases=['dnslookup', 'nslookup'])
|
@commands.command(name='dig', aliases=['dnslookup', 'nslookup'])
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def dig(self, ctx: commands.Context, name: str, type: str | None = 'A', server: str | None = None, port: int = 53) -> None:
|
async def dig(self, ctx: commands.Context, name: str, type: str | None = 'ANY', server: str | None = None, port: int = 53) -> None:
|
||||||
"""Retrieve DNS information for a domain."""
|
"""Retrieve DNS information for a domain."""
|
||||||
command_opts: list[str | int] = ['dig']
|
command_opts: list[str | int] = ['dig']
|
||||||
if server:
|
if server:
|
||||||
command_opts.extend(['@', server])
|
command_opts.extend(['@', server])
|
||||||
command_opts.extend([name, type])
|
command_opts.extend([name, type, '-p', port, '+yaml'])
|
||||||
if port != 53:
|
|
||||||
command_opts.extend(['-p', port])
|
|
||||||
command_opts.extend(['+yaml'])
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
process: Process = await asyncio.create_subprocess_exec(*command_opts, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
|
process: Process = await asyncio.create_subprocess_exec(*command_opts, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
|
||||||
|
|
Loading…
Reference in a new issue